RePast
v. 2.0

uchicago.src.sim.Schelling
Class SchellingAgent

java.lang.Object
  |
  +--uchicago.src.sim.Schelling.SchellingAgent

public class SchellingAgent
extends Object

This is a Schelling agent. This agent occupies one polygon in the space. It decides whether or not to move based on the percentage of its neighbors who are the same color. If that percent different is lower than this agent's tolerance, then the agent stays. Otherwise, the agent finds a random unoccupied space.


Constructor Summary
SchellingAgent(double tol, SchellingPolygon loc, Color c)
           
 
Method Summary
 Color getColor()
           
 GisLayer getLayer()
           
 SchellingPolygon getLoc()
           
 double getTolerance()
           
 void setColor(Color color)
           
 void setLayer(GisLayer layer)
           
 void setLoc(SchellingPolygon loc)
           
 void setTolerance(double tolerance)
           
 void step()
          Step method should be executed every tick in schedule.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchellingAgent

public SchellingAgent(double tol,
                      SchellingPolygon loc,
                      Color c)
Method Detail

getLayer

public GisLayer getLayer()

setLayer

public void setLayer(GisLayer layer)

getLoc

public SchellingPolygon getLoc()

setLoc

public void setLoc(SchellingPolygon loc)

getTolerance

public double getTolerance()

setTolerance

public void setTolerance(double tolerance)

getColor

public Color getColor()

setColor

public void setColor(Color color)

step

public void step()
Step method should be executed every tick in schedule. Find the percentage of my neighbors who are different than me. If that percentage is greater than my tolerance, move to an unoccupied polygon.


RePast
v. 2.0

Bug reports and feature requests to RePast