Class CrowdAgent
java.lang.Object
SimpleTurtle
Turtle
Agent
CrowdAgent
- public class CrowdAgent
- extends Agent
Method Summary |
void |
act(int t)
act(t) For first 10 steps, walk around,
Then walk AWAY from the bigger, mighter dog "Hunter", and coninue wandering around. |
void |
init(Simulation thisSim)
Set up the dogs |
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 |
dog1
public static Picture dog1
dog2
public static Picture dog2
dogwag
public static Picture dogwag
CrowdAgent
public CrowdAgent(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
CrowdAgent
public CrowdAgent(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)
- Set up the dogs
- Overrides:
init
in class Agent
act
public void act(int t)
- act(t) For first 10 steps, walk around,
Then walk AWAY from the bigger, mighter dog "Hunter", and coninue wandering around.
- Overrides:
act
in class Agent