|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdemo.CarryDropAgent
Agent for the CarryDrop model. The agent includes basic internal variables, methods for modifying an agent's position and direction, ID variables, etc.
Constructor Summary | |
CarryDropAgent(int minLifeSpan,
int maxLifeSpan)
Constructor that takes the ranges of permissible life spans |
Method Summary | |
void |
draw(uchicago.src.sim.gui.SimGraphics G)
Draw this agent to the RePast graphics object. |
java.lang.String |
getID()
Get this agent's internal unique ID |
int |
getMoney()
Get the amount of money held by this agent |
int |
getStepsToLive()
Get the number of steps this agent has remaining in its 'stepsToLive' variable. |
int |
getX()
Get this agent's X position |
int |
getY()
Get this agent's Y position |
void |
receiveMoney(int amount)
Receive an amount of money and put it in the agent's holdings. |
void |
report()
Prints a report on this agent's status variables to the System output |
void |
setCarryDropSpace(CarryDropSpace cds)
Set this agent's pointer to the space object in which it resides. |
void |
setXY(int newX,
int newY)
Set a new X and Y position for the agent. |
void |
step()
A basic 'step' for this agent- the actions it takes when it is the agent's 'turn' in the simulation |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CarryDropAgent(int minLifeSpan, int maxLifeSpan)
minLifeSpan
- Shortest possible life spanmaxLifeSpan
- Longest possible life spanMethod Detail |
public void setXY(int newX, int newY)
newX
- newY
- public void setCarryDropSpace(CarryDropSpace cds)
cds
- The space object into which the agent is
being placedpublic java.lang.String getID()
public int getMoney()
public int getStepsToLive()
public void report()
public int getX()
getX
in interface uchicago.src.sim.gui.Drawable
public int getY()
getY
in interface uchicago.src.sim.gui.Drawable
public void draw(uchicago.src.sim.gui.SimGraphics G)
draw
in interface uchicago.src.sim.gui.Drawable
G
- the graphics object to which this agent
will be drawnpublic void step()
public void receiveMoney(int amount)
amount
- the amount of money received
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |