|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSimpleTurtle
Turtle
Agent
DeerAgent
DeerAgent -- Deer as a subclass of Agent
Field Summary | |
static LinkedList |
allDeer
Collection of all Deer |
Fields inherited from class Agent |
MAXSPEED, myPict, PROB_OF_STAY, randNumGen, simulation, speed |
Constructor Summary | |
DeerAgent(int x,
int y,
ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the x and y and a model display to draw it on |
|
DeerAgent(ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned) |
Method Summary | |
void |
act()
How a DeerAgent acts |
void |
die()
To die, do normal stuff, but also remove from deer list |
void |
init(Simulation thisSim)
Initialize, by adding to Deer list |
Methods inherited from class Agent |
act, countInRange, getClosest, getSimulation, getSpeed, setSpeed |
Methods inherited from class Turtle |
square |
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static LinkedList allDeer
Constructor Detail |
public DeerAgent(ModelDisplay modelDisplayer, Simulation thisSim)
modelDisplayer
- thing that displays the modelthisSim
- my simulationpublic DeerAgent(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 void init(Simulation thisSim)
init
in class Agent
public void die()
die
in class Agent
public void act()
act
in class Agent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |