Class PoliticalAgent
java.lang.Object
SimpleTurtle
Turtle
Agent
PoliticalAgent
- public class PoliticalAgent
- extends Agent
PoliticalAgent -- Red or Blue Stater as a subclass of Agent
Methods inherited from class SimpleTurtle |
backward, drawInfoString, drop, forward, forward, getBodyColor, getDistance, getHeading, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getPicture, getShellColor, getShowInfo, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setPicture, setShellColor, setShowInfo, setVisible, show, toString, turn, turnLeft, turnRight, turnToFace, turnToFace, updateDisplay |
politics
public Color politics
stuckness
public int stuckness
redParty
public static LinkedList redParty
blueParty
public static LinkedList blueParty
PoliticalAgent
public PoliticalAgent(ModelDisplay modelDisplayer,
Simulation thisSim)
- Constructor that takes the model display (the original
position will be randomly assigned)
- Parameters:
modelDisplayer
- thing that displays the modelthisSim
- my simulation
PoliticalAgent
public PoliticalAgent(int x,
int y,
ModelDisplay modelDisplayer,
Simulation thisSim)
- Constructor that takes the x and y and a model
display to draw it on
- Parameters:
x
- the starting x positiony
- the starting y positionmodelDisplayer
- the thing that displays the modelthisSim
- my simulation
init
public void init(Simulation thisSim)
- Initialize
- Overrides:
init
in class Agent
setPolitics
public void setPolitics(Color pref)
- Set politics
act
public void act()
- How a PoliticalAgent acts
- Overrides:
act
in class Agent