These pages describe and explain C programs which implement Thomas Schelling's model of segregation from Micromotives and Macrobehavior, also sometimes referred to as Schelling's tipping model. There are three versions of the C program, starting from a simple one and then adding some more features. The code was written by Benedikt Stefansson and follows a Pascal program of the same model by Robert Axelrod. You can read annotated files explaining the programs:
Or you can go directly to the code. If you want to compile this code it is probably wise to shift-click on the links, and save directly to disk:Assuming that you are compiling this on a Unix computer with the gcc compiler, issue the following statement:
If you find problems with the code please contact the author.