|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SimpleTurtle Turtle Agent DEAgent Distributor
public class Distributor
Distributor -- takes orders from Market to Warehouse, fills them, and returns with product.
Field Summary | |
---|---|
static int |
MARKET_ARRIVE
message that means things have arrived at the market |
static int |
MARKET_LEAVE
message that means the goods have left the market |
static int |
WAREHOUSE_ARRIVE
message that means items arrived at the warehouse |
Fields inherited from class Agent |
---|
MAX_SPEED, PROB_OF_STAY, randNumGen |
Constructor Summary | |
---|---|
Distributor(int x,
int y,
ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the x and y, a model display to draw it on, and the simulation |
|
Distributor(ModelDisplay modelDisplayer,
Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned) and the simulation |
Method Summary | |
---|---|
void |
init(Simulation thisSim)
Initialize a distributor. |
boolean |
isReady(Resource res)
Method to check if we are we ready to be unlocked? |
int |
newOrders()
return the number of new orders |
void |
processEvent(int message)
Process an event. |
double |
timeToDeliver()
return the time to deliver |
double |
tripTime()
return the trip time |
void |
unblocked(Resource resource)
I've been unblocked! |
Methods inherited from class DEAgent |
---|
isBlocked, 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 MARKET_ARRIVE
public static final int MARKET_LEAVE
public static final int WAREHOUSE_ARRIVE
Constructor Detail |
---|
public Distributor(ModelDisplay modelDisplayer, Simulation thisSim)
modelDisplayer
- thing that displays the modelthisSim
- my simulationpublic Distributor(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 newOrders()
public double timeToDeliver()
public double tripTime()
public void init(Simulation thisSim)
init
in class DEAgent
thisSim
- the simulationpublic boolean isReady(Resource res)
isReady
in class DEAgent
res
- the resource
public void unblocked(Resource resource)
unblocked
in class DEAgent
resource
- the desired resourcepublic void processEvent(int message)
processEvent
in class DEAgent
message
- the message to process
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |