|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectSimpleTurtle
Turtle
Agent
DEAgent
Truck
Truck -- delivers product from Factory to Warehouse.
Field Summary | |
static int |
FACTORY_ARRIVE
|
int |
load
Amount of product being carried |
static int |
WAREHOUSE_ARRIVE
|
Fields inherited from class DEAgent |
blocked |
Fields inherited from class Agent |
MAXSPEED, myPict, PROB_OF_STAY, randNumGen, simulation, speed |
Constructor Summary | |
Truck(int x,
int y,
ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the x and y and a model display to draw it on |
|
Truck(ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned) |
Method Summary | |
void |
init(Simulation thisSim)
Set up the truck Start out at the factory |
int |
newLoad()
A new load is between 10 and 20 on a uniform distribution |
void |
processEvent(int message)
Process an event. |
double |
tripTime()
A trip distance averages 3 days |
Methods inherited from class DEAgent |
isBlocked, isReady, unblocked, validTime, waitFor |
Methods inherited from class Agent |
act, act, countInRange, die, 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 final int FACTORY_ARRIVE
public static final int WAREHOUSE_ARRIVE
public int load
Constructor Detail |
public Truck(ModelDisplay modelDisplayer, Simulation thisSim)
modelDisplayer
- thing that displays the modelthisSim
- my simulationpublic Truck(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 int newLoad()
public double tripTime()
public void init(Simulation thisSim)
init
in class DEAgent
public void processEvent(int message)
processEvent
in class DEAgent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |