Schelling's Tipping Model of Segregation This is an implementation of Thomas C. Schelling's simple model of segregation, as described in his book ``Micromotives and Macrobehavior'' (Norton, NY, 1978!), and in a paper in volume 1 of Math Sociology. There are two types of Agents -- Red (type 1) and Green (type 2). Each type has a threshold for whether it is happy where it is or not (thresholdR, thresholdG), which is a value in [0,1]. An agent is happy if the fraction of its neighbors of its own type is >= the threshold for its type. An agent's neighbors are agents in the cells immediately surrounding it (i.e., in its Moore neighborhood). However, it is a bounded world, so agents at edges and in corners have different number of potential neighbors, and of course they can't move through the edge (as they would in a torus). Note also that agents don't count themselves when calculating the fraction of same type in their neighborhood. So, each step every agent is given a chance to move. An agent stays put if fraction of same type of neighbors is >= threshold. Otherwise the agent tries to move. (Agents only move to open sites, of course.) There are three moveMethods: (1) random pick a new site uniform randomly (2) nearest-open look around for all sites that are nearest (manhattan distance), and pick one from those at random. (3) nearest-ok look around for all sites that both acceptable (i.e., the fraction of same type is >= agent's threshold) and nearest, and from those select one at random. Note Well: when you change a parameter, you must press the (Return) key after you change the value for the change to take effect. You will see the frame around the parameter value briefly flash red. Rather than having all the agents get one chance to move each ``step'' (i.e., each click of the Next button), one can instead have only one agent be given a chance to move each ``Next'' click, by setting the oneStepMode parameter to 1 (instead of the default, 0). In this mode, the next agent to move is marked Blue if its a Green type, otherwise its marked While if its a Red type that wants to move next. Also, there is a settable variable randomMoveProb, which can be in [0,1]. If it is > 0, each agent makes a random move, and no other, on a given step. NB: if oneStepMode is on, the randomMoveProb is ignored. Agents are displayed in a 2D raster, in two colors, plus black for open sites. Mouse clicks on agents world produce these effects: MB1 (left): toggle type MB3 (right): probe that agent, so you can watch its instance variables (internal state) change from step to step. There are a few graphs that are displayed in real time when run in GUI mode. This show a number of measures: Notes on Measures: Count vs T movesThisT - number of moves made in a given step (not counting moves caused by randomMoveProb). numFullySegG - number of fully segregated agents of type Green (ie all neighbors of type green) numFullySegR - ditto for Red agents Pop Avgs vs T (#1) avgNumSameG/R - average number of neighbors of the same type that each Green (or Red) agent has Pop Avgs vs T (#2) avgFracSameG/R - average fraction of same type neighbors for Red/Green minFracSameG/R Note that fracSameNbor = 0 if no agent has no neighbors at all. Thus an isolated agent is *not* counted as fully segregated. Examples: To run with threshold for Red agents at 0.7, using the nearest-open move method, and all other parameters at defaults: ./tipping -DthresholdRed=0.7 -Dmm="nearest-open" After you run it, there will be a file report which contains the initial parameter values, any changes you made, and lines of output data. You can have it write to files of different names, e.g. ./tipping -DRFN=output -DRN=00 will write to a file output.00 (The RNF is report file name, the RN is report file name suffix). To get a list of all run-time settable parameters and their aliases: ./tipping -Dh NOTE: These parameters you can change only before creating the first agents (ie, before pressing Start or Next the first time): numAgents worldSize fractionRed These variables you can change at any time in the run: thresholdRed, thresholdGreen moveMethod randomMoveProb oneStepMode Be sure to press Enter (Return) after you change a value, or it won't take effect. Note also the first time you press Start or Next, it just creates the initial agents and graphs. Then next time you press Next/Start takes the first step(s). If you press Next, you must press it again to see the lines start on the graphs. Agent color codes: 1 Red 2 Green 3 White 4 Pink 5 DarkGreen 6 Blue If you probe an agent and change the color, you can press the reDrawAgents button to have the color redrawn without the model taking a step. ======================================================================= Updates: July, 1999; July 2000;