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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SchellingAgent
public SchellingAgent(double tol,
SchellingPolygon loc,
Color c)
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.
Bug reports and feature requests to RePast