|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuchicago.src.sim.engine.SimModelImpl
demo.CarryDropModel
CarryDropModel is a RePast model that demonstrates the basics of building a RePast model. The model's dynamics are straightforward: a space is populated with agents. Money is distributed on the landscape; agents move and pick up money. When agents collide the agent that initiated the collision gives one unit of money to the other agent. Agents have limited lifespans and when they die their money is distributed randomly across the landscape.
Constructor Summary | |
CarryDropModel()
|
Method Summary | |
void |
begin()
Initialize the model by building the separate elements that make up the model |
void |
buildDisplay()
Build the display elements for this model. |
void |
buildModel()
Initialize the basic model by creating the space and populating it with money and agents. |
void |
buildSchedule()
Create the schedule object(s) that will be executed during the running of the model |
int |
getAgentMaxLifespan()
Get the maximum value for an agent's lifespan |
int |
getAgentMinLifespan()
Get the minimum value for an agent's lifespan |
java.lang.String[] |
getInitParam()
Get the string array that lists the initialization parameters for this model |
int |
getMoney()
Get the value of the parameter initializing the total amount of money in this model |
java.lang.String |
getName()
Get a String that serves as the name of the model |
int |
getNumAgents()
Get the parameter indicating the number of agents in this model |
uchicago.src.sim.engine.Schedule |
getSchedule()
Returns the Schedule object for this model; for use internally by RePast |
int |
getWorldXSize()
Get the width of the space in the model |
int |
getWorldYSize()
Get the heighth of the space in the model |
static void |
main(java.lang.String[] args)
Main method for this model object; this runs the model. |
void |
setAgentMaxLifespan(int i)
Set the maximum value for an agent's lifespan |
void |
setAgentMinLifespan(int i)
Set the minimum value for an agent's lifespan |
void |
setMoney(int i)
Set the new value for the total amount of money to be used when initializing the simulation |
void |
setNumAgents(int na)
Set the parameter indicating the initial number of agents for this model. |
void |
setup()
Tear down any existing pieces of the model and prepare for a new run. |
void |
setWorldXSize(int wxs)
Set the parameter initializing the width of the space object in this model |
void |
setWorldYSize(int wys)
Set the parameter initializing the heighth of the space object in this model |
Methods inherited from class uchicago.src.sim.engine.SimModelImpl |
addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireNumericPropertyEvent, fireObjectPropertyEvent, fireSimEvent, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, getTickCountDouble, pause, registerDisplaySurface, registerMediaProducer, removeSimEventListener, setController, setRngSeed, stop |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CarryDropModel()
Method Detail |
public java.lang.String getName()
public void setup()
public void begin()
public void buildModel()
public void buildSchedule()
public void buildDisplay()
public uchicago.src.sim.engine.Schedule getSchedule()
public java.lang.String[] getInitParam()
public int getNumAgents()
public void setNumAgents(int na)
na
- new value for initial number of agents.public int getWorldXSize()
public void setWorldXSize(int wxs)
wxs
- the new size of the X-dimension of the model.public int getWorldYSize()
public void setWorldYSize(int wys)
wys
- the new size of the Y-dimension of the model.public int getMoney()
public void setMoney(int i)
i
- the new value for the total amount of moneypublic int getAgentMaxLifespan()
public int getAgentMinLifespan()
public void setAgentMaxLifespan(int i)
i
- the maximum value for an agent's lifespanpublic void setAgentMinLifespan(int i)
i
- the minimum value for an agent's lifespanpublic static void main(java.lang.String[] args)
args
- Any string arguments to be passed to this model (currently none)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |