|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTurtle Turtle Agent DEAgent Truck
public class Truck
Truck -- delivers product from the Factory to the Warehouse.
Field Summary | |
---|---|
static int |
FACTORY_ARRIVE
an arrive at factory event |
static int |
WAREHOUSE_ARRIVE
an arrive at warehouse event |
Fields inherited from class Agent |
---|
MAX_SPEED, PROB_OF_STAY, randNumGen |
Constructor Summary | |
---|---|
Truck(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 |
|
Truck(ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned) and a simulation |
Method Summary | |
---|---|
void |
init(Simulation thisSim)
Set up the truck Start out at the factory |
int |
newLoad()
A method to create a new load. |
void |
processEvent(int message)
Process an event. |
double |
tripTime()
Calculate and return the total trip time |
Methods inherited from class DEAgent |
---|
isBlocked, isReady, unblocked, validTime, waitFor |
Methods inherited from class Agent |
---|
act, 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 |
Field Detail |
---|
public static final int FACTORY_ARRIVE
public static final int WAREHOUSE_ARRIVE
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
thisSim
- the simulationpublic void processEvent(int message)
processEvent
in class DEAgent
message
- the type of event
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |