The Schelling Segregation Model
Demonstration Software


Site Created and Maintained by: Chris Cook
Last updated: 29 December 2011

Table of Contents:

ACE Website
ACE Demo Software
Quick Download: Schelling v1.1.zip (231KB)

Schelling Screen Shot


 
Introduction to the Schelling Segregation Model [top]

The Schelling Segregation Model (SSM), also referred to as the "Schelling Tipping Model," was first developed by Thomas C. Schelling (Micromotives and Macrobehavior, W. W. Norton and Co., 1978, pp. 147-155). It represents one of the first constructive models of a dynamic interacting-agent system explicitly designed to explore an important social issue.

Schelling placed pennies and dimes on a chess board and moved them around according to various rules. He interpreted the board as a city, with each square of the board representing a house or a lot. He interpreted the pennies and dimes as agents representing any two groups in society, such as two different races of people, boys and girls, smokers and non-smokers, etc. The neighborhood of an agent occupying any location on the board consisted of the squares adjacent to this location. Thus, interior (non-edge) agents could have up to eight neighbors, non-corner edge agents could have a maximum of five neighbors, and corner edge agents could have a maximum of three neighbors. Rules could be specified that determined whether a particular agent was happy in its current location. If it was unhappy, it would try to move to another location on the board, or possibly just exit the board entirely.

As can be expected, Schelling found that the board quickly evolved into a strongly segregated location pattern if the agents' "happiness rules" were specified so that segregation was heavily favored. Surprisingly, however, he also found that initially integrated boards tipped into full segregation even if the agents' happiness rules expressed only a mild preference for having neighbors of their own type.


SSM Demo Description [top]
Software has been developed that implements a version of the Schelling Segregation Model (SSM) as an interactive computer demo. The SSM demo features a complete graphical interface so that the user can click buttons to control the demo and actually see what the board looks like, as opposed to typing commands at a prompt and receiving a text readout. The demo also allows the user to customize several parameters, thus enabling the user to perform a wide range of experiments. The customizable parameters can be accessed through the following tabs and menu options at the main demo screen:
  • "Game" Tab (Starting Configuration of the Board): Users can select one of several preset configurations or create their own that include up to three distinct types of agents (red, blue, and green) together with vacant squares. Agents have differing upper limits on the number of their neighbors depending on their location. (Corner agents can have a maximum of three neighbors, edge agents can have a maximum of five neighbors, and center agents can have a maximum of eight neighbors.)

  • "Options" Tab (Relocation Rules): A location is referred to as suitable for an agent if the agent is (or would be) happy at that location. The user can enable or disable rules that force unhappy agents to move to a closest suitable vacant location or that allow an unhappy agent to exit the board entirely if no suitable vacant locations are found.

  • "Happiness Rules" Tab: The user can customize the rules defining whether each agent is happy in its current location. Each distinct type of agent (red/blue/green) has a distinct user-specified happiness rule. For each given configuration of neighbors that an agent might have, the happiness rule for this agent's type specifies how many of these neighbors must be the same type as the agent in order for the agent to be happy to stay put at its current location. By specifying distinct happiness rules for the three agent types, the user can specify varying preferences for segregation among the three agent types.

  • "View" Menu Options (Color Shadings): The "View" menu permits users to select either "black/white" or "indicate happiness." Under the first option, all board visualizations are rendered in black/white for easier printing. Under the second option, all board visualizations are in color. In particular, after the play of a run begins, happy red, blue, and green agents are indicated by bright color shades and unhappy red, blue, and green agents are indicated by darker color shades. This use of bright/darker shadings permit users to immediately see the effects on "previous neighbors" and "new neighbors" when an agent chooses to move to a new location.
Other features of the SSM demo (V1.1) include:
  • "Contents" Option on Help Menu: "Contents" provides the user with a description of the demo's general capabilities together with instructions for the use of many of the demo's control settings.

  • "Show Animation" Option on Main Demo Screen: The user can select either to view the transformation of the board at a controllable speed or to jump directly to a view of the final configuration.

  • "Experiment Number" (Random Seed Value) on Main Demo Screen: Pseudo-random numbers (PRNs) are used at various places throughout the demo. An experimental run for any given configuration of parameter values is identified by the value of the random seed used to generate the PRNs for this run. The user can use the default random seed provided in a box on the main demo screen or the user can choose "Select Experiment Number" and provide their own random seed in this box.

  • "Save/Open" Option on File Menu: By saving the value of the random seed along with the values of all parameters and option settings for a run, users can exactly replicate this run at a later time. This saving is done through the "Save" option on the File menu. Selecting "Save" permits the user to save the current configuration of the SSM demo, including the random seed, the current set-up of the board, the happiness rules, and all other option settings. This saved configuration can be copied to a disk or to a computer directory and then reloaded at a later time using the "Open" option on the File menu.
Screen shots for the SSM Demo (V1.0) can be viewed here: the starting configuration of the board, the happiness rules setting screen, the relocation options screen, and the output data screen.

SSM Demo Downloads [top]

Demo Installation Package Schelling v1.1.zip Includes the setup files necessary to install this demo on your computer.
.Net Framework Redistributable Package Microsoft .Net Homepage The .Net Framework Redistributable Package (Version 1.1 or higher) must be installed on your computer in order to run this demo. It can be acquired via Windows Update on your computer or at this website. For installation directions or to see if you already have it, see the installation notes below.
Installation Notes Schelling Install Notes.html Provides information for installing the demo, determining if you have the .Net Framework, and installing it if you do not.


SSM Demo Source Code and Implementation Info [top]


IMPLEMENTATION:

I wrote this windows application in C# using Microsoft's Visual Studio .Net. I chose .Net because it allows for quick development of a GUI based windows application, and I used C# so that less code would have to be changed if anyone wished to port the windows application to an internet-based web application.

You can download all the files necessary to load the application in a .Net IDE here. A synopsis of all the classes, variables, methods, etc. (automatically created with Visual Studio .Net) can be viewed by clicking here.

LOGICAL FLOW OF THE SSM DEMO:

Each experimental run of the SSM Demo proceeds as follows:

  • When the user clicks the start button, the board configuration is copied into an array and a location on the board is randomly selected to be the first agent checked for happiness.
  • If the selected agent is happy in its current location, it does not move. The number of iterations increases by one.
  • If the selected agent is NOT happy in its current location, then it searches for a better location to move to. This search process is conditional on whether the user has selected (or not) each of the following search options: Option (1) -- unhappy agents try to move to a closest suitable vacant location; and Option (2) -- unhappy agents exit the board if no suitable vacant locations exist. Recall from earlier discussion that a location is referred to as suitable for an agent if the agent is (or would be) happy at that location.
  • Suppose NO suitable vacant location exists. If Option (2) is in effect, the unhappy agent exits the board. Otherwise the unhappy agent randomly selects a location from among the collection of all unsuitable vacant locations (together with its current location) and moves to (or remains at) this selected location. (The inclusion of the unhappy agent's current location protects against the possibility that no vacant locations exist, suitable or not.) In either case the number of iterations increases by one.
  • Suppose a suitable vacant location exists. If Option (1) is in effect, the unhappy agent moves to a closest suitable location (breaking ties with a "coin flip.") If Option (1) is not in effect, the unhappy agent randomly selects a location from among the collection of all unsuitable vacant locations (together with its current location) and moves to (or remains at) this selected location. In either case the number of iterations increases by one.
  • After the selected agent has had a chance to stay put (if happy) or to move (if unhappy), the SSM demo moves on to the next agent. Control repeatedly flows from left to right and from top to bottom across the board.
  • The experimental run ends when one of the following conditions is met:
    1. The designated number of iterations has been met.
    2. All agents left on the board are either happy or unable to move (i.e., the agent location pattern is stable).


Copyright Information [top]
This SSM demo is licensed by the copyright holder (Chris Cook) as free open-source software under the GNU Public License. Anybody who is interested is allowed to view, modify, and/or improve upon the code used to produce this demo, but any software generated using all or part of this code must be released as free open-source software as well. To view the software license in its entirety, go here.


Feedback [top]
You may contact me at chrisdcook@gmail.com. I would greatly appreciate your comments and suggestions.

Copyright 2011 Chris Cook. All Rights Reserved.