|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTurtle Turtle Agent DeerAgent
public class DeerAgent
DeerAgent -- Deer as a subclass of Agent
Field Summary | |
---|---|
static LinkedList<DeerAgent> |
allDeer
Collection of all Deer |
static Color |
BROWN
class constant for the color |
static double |
SMELL_RANGE
class constant for how far deer can smell |
Fields inherited from class Agent |
---|
MAX_SPEED, PROB_OF_STAY, randNumGen |
Constructor Summary | |
---|---|
DeerAgent(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 |
|
DeerAgent(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 DeerAgent acts |
void |
die()
To die, do normal stuff, but also remove from deer list |
static LinkedList<DeerAgent> |
getDeer()
Method to get the linked list of deer |
void |
init(Simulation thisSim)
Initialize, by adding to Deer list |
Methods inherited from class Agent |
---|
act, countInRange, 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 |
Field Detail |
---|
public static final Color BROWN
public static final double SMELL_RANGE
public static LinkedList<DeerAgent> 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 static LinkedList<DeerAgent> getDeer()
public void init(Simulation thisSim)
init
in class Agent
thisSim
- the simulationpublic 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 |