Schelling's segregation model

Thomas Schelling, in 1971, showed that a small preference for one's neighbors to be of the same color could lead to total segregation. He used coins on graph paper to demonstrate his theory by placing pennies and nickels in different patterns on the "board" and then moving them one by one if they were in an "unhappy" situation. Here's the high-tech equivalent. The rule this ALife model operates on is that for every colored cell, if greater than 33% of the adjacent cells are of a different color, the cell moves to another randomly selected cell.

This is my first experiment with writing computer programs to simulate interesting processes we come across in real life. There are a number of reasons why this kind of simulation is useful and I'll try to summarize what in my mind are the main ones:

For more information on Schelling's segregation model, please see:
Schelling, Thomas C. 1971. "Dynamic Models of Segregation." Journal of Mathematical Sociology 1:143-186.

Krugman, Paul 1996. The Self-Organizing Economy Blackman, New York.

W.A.V. Clark 1991. "Residential Preferences and Neighborhood Racial Segregation: A Test of the Schelling Segregation Model." Demography 28:1.

For more information on artifial life models, please see Exploring Emergence, Sugarscape and Swarm.