Schelling Model of Racial Segregation

[download]

[postmortem]

 

This was a serious project for the Institute for Complex Additive Systems Analysis I did, back in 2006, to get up to speed on basic modeling principles(agent based modeling), cellular automata, and more hands on work in Java. What follows is the user manual and then my postmortem.

 

To run: Double click on Schelling_Model.exe or bring up the command prompt and type in "java main" (without quotes.)

 

Welcome to the Schelling Model of Racial Segregation program. The model shows how segregation can happen when even people are very tolerant. Over a certain, small value, the markers group up into areas completely segregated. The model works by first randomly distributing all the markers onto the board. The markers will decide if they are unhappy with their neighborhood based on the ratio of the markers similar to them vs. the total markers in the neighborhood: S/T (A neighborhood consists of the 8 squares surrounding one square and the grid wraps around as to not inhibit possible moves.) This model assumes that no one will want to be alone either, so markers totally isolated will move. When a marker moves, it moves to a random position adjacent to their current position.

 

To run the model, open the terminal and navigate to the folder and type in java main

Note: You need to have Java 1.5 or higher to run the model.

 

When you run the model, you are greeted with a screen asking for the simulation parameters:

 

Picture of Simulation Parameters

 

The X and Y values are the size of the grid. The next two are the number of counters that will be placed on the grid randomly of each color. The C value is the ratio of at least how many markers must be the same in the neighborhood vs. the total markers in the neighborhood in order for that marker to stay put. Max iterations is how many times the simulation will run, each iteration all the markers that are unhappy with their neighborhoods will move. Setting it to 0 will run until all the markers are happy or you quit the model. Animation delay will be how fast the changes are shown, and the animate single option will move one marker at a time instead of showing all the changes at once.

 

Click run to be taken to the next screen or click clear to reset to default values.

 

Picture of the program

Windows Users vs. Linux Users

 

This screen shows the simulation running. The bar on the bottom shows the current parameters, the results of the parameters, and buttons to control the simulation.

 

Iter: is the current iteration.

 

# moved: this is how many markers moved in the last iteration.

 

Avg S/T: this is the average same/total value from the last iteration. Higher means more segregated.

 

Start Button: press this to start the simulation. This button will then change to pause where you can pause the simulation and resume it.

 

Reset button: press this to start a new simulation with all the same values.

 

New button: press this to get the parameters screen and so you can start a new simulation.

 

Cancel button: press this to exit the simulation.

 

Load Custom Images button: this button allows you to load your own .jpg and .gif images as markers. The image size should be 40 pixels by 40 pixels although the program will resize the images to this size.

 

 

Postmortem

 

Overall, the model went quite well. It was able to reproduce results exactly as Schelling's model predicted. Other people at ICASA were able to easily use and understand the program. However while I was looking back, there were some issues.

 

The included Chuck Norris random fact generator easter egg was over the top and wasn't appreciated by anyone else on the team other than my direct manager. I had a moment of professional growth when I displayed it to the team and some of the more lewd jokes happened to pop up, which I didn't intend to. What happened was that I copied like the entire database of Chuck Norris jokes at the time and didn't go through all of them. I think I later removed the unprofessional ones and just left one in.

 

The Schelling Model didn't scale well to large simulations due to inefficient memory usage. I basically did it on a huge MxN array.  

 

The default animation setting were too slow for users to enjoy.

 

[top]