|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTurtle Turtle Agent PoliticalAgent
public class PoliticalAgent
PoliticalAgent -- Red or Blue Stater as a subclass of Agent
Field Summary |
---|
Fields inherited from class Agent |
---|
MAX_SPEED, PROB_OF_STAY, randNumGen |
Constructor Summary | |
---|---|
PoliticalAgent(int x,
int y,
ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the x and y, a model display to draw it on, and a simulation |
|
PoliticalAgent(ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned) and the simulation |
Method Summary | |
---|---|
void |
act()
How a PoliticalAgent acts |
static LinkedList<PoliticalAgent> |
getBluePartyList()
Return the linked list of blue party agents |
Color |
getParty()
Method to get the party |
static LinkedList<PoliticalAgent> |
getRedPartyList()
Return the linked list of red party agents |
void |
init(Simulation thisSim)
Initialize the simulation |
void |
setParty(Color pref)
Set the party |
Methods inherited from class Agent |
---|
act, countInRange, die, getClosest, getPicture, getSimulation, getSpeed, setPicture, setSpeed |
Methods inherited from class SimpleTurtle |
---|
backward, backward, clearPath, drawInfoString, drop, forward, forward, getBodyColor, getDistance, getHeading, getHeight, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getShellColor, getShowInfo, getWidth, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setHeight, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setShellColor, setShowInfo, setVisible, setWidth, show, toString, turn, turnLeft, turnRight, turnToFace, turnToFace, updateDisplay |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PoliticalAgent(ModelDisplay modelDisplayer, Simulation thisSim)
modelDisplayer
- thing that displays the modelthisSim
- my simulationpublic PoliticalAgent(int x, int y, ModelDisplay modelDisplayer, Simulation thisSim)
x
- the starting x positiony
- the starting y positionmodelDisplayer
- the thing that displays the modelthisSim
- my simulationMethod Detail |
---|
public static LinkedList<PoliticalAgent> getRedPartyList()
public static LinkedList<PoliticalAgent> getBluePartyList()
public Color getParty()
public void init(Simulation thisSim)
init
in class Agent
thisSim
- the simulationpublic void setParty(Color pref)
pref
- the new party to usepublic void act()
act
in class Agent
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |