The applet below implements one version of the Schelling Segregation Model. There's a lot of versions of this model available on the web. It's not clear from the various models exactly what relocation method one should use: indeed, they all use different models. For purposes of demonstration the model in the applet below simply does relocation via moving to a random new location (which is unsatisfactory of course!). Under the Model tab you can change various experimental parameters.
Source code as a zip file.