|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--uchicago.src.sim.engine.BaseController
|
+--uchicago.src.sim.engine.BatchController
A controller for running a simulation over multiple runs.
See SimInit for more on how to run a
simulation in batch mode. BatchController should not be
created by a user under normal circumstances.
SimInit| Field Summary | |
protected long |
batchCount
|
protected ArrayList |
dynNameList
|
protected boolean |
finished
|
protected ArrayList |
nameList
|
protected Hashtable |
nameParam
|
protected String[] |
pArray
|
protected Hashtable |
writeHeader
|
| Fields inherited from class uchicago.src.sim.engine.BaseController |
done, doStep, executeBegin, go, isGui, listenerList, model, monitor, params, pauseActionsExecuted, pauseAt, pauseAtAction, pauseSim, persistentObj, runFinished, runThread, schedule, simRun, sleepValue, time |
| Constructor Summary | |
BatchController(Vector parameters)
Creates a BatchController with the specified model parameters. |
|
| Method Summary | |
void |
begin()
Begins the batch runs |
boolean |
doWriteHeader(String fileName)
Should the header for the specified file be written. |
void |
exitSim()
Exits the entire simulation. |
long |
getBatchCount()
Gets the number of the current batch run |
ArrayList |
getDynamicParameterNames()
Gets a list of the Dynamic (non-constant) Parameter names. |
ArrayList |
getParameterNames()
Gets a list of the parameter names. |
String |
getParameterValue(String name)
Gets the current value of the named Parameter. |
boolean |
isBatch()
Is this a batch run. |
boolean |
isParameter(String name)
Is the named property a Parameter from a Parameter file. |
boolean |
isParameterConstant(String name)
Is the named Parameter a constant Parameter. |
void |
onTickCountUpdate()
Empty method as nothing to update when the tick count is incremented |
void |
removeParameter(String name)
Removes the named Parameter from the internal list of model parameter names, but not from the Parameter list itself. |
void |
setModel(SimModel model)
Sets the model to be controlled by this BatchController. |
void |
setWriteHeader(String filename,
boolean val)
Sets whether the header for the specified file should be written. |
void |
simEventPerformed(SimEvent evt)
Called by a source on which this is a listener when a SimEvent is performed. |
void |
start()
Starts an individual run of the simulation |
void |
stopRun()
Stops an individual run of the simulation, increments the parameters appropriately, and if necessary starts another run. |
| Methods inherited from class uchicago.src.sim.engine.BaseController |
addSimEventListener, beginModel, fireSimEvent, getCellDepth, getCellHeight, getCellWidth, getCurrentTime, getCurrentTimeDouble, getDefaultModelParameters, getModel, getModelParameters, getPauseAt, getPersistentObj, getRandomSeed, getSchedule, notifyMonitor, pauseSim, putPersistentObj, removeSimEventListener, setCellDepth, setCellHeight, setCellWidth, setPauseAt, setRandomSeed, setSchedule, setupSchedule, startSim, stopSim |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String[] pArray
protected long batchCount
protected Hashtable writeHeader
protected ArrayList nameList
protected ArrayList dynNameList
protected Hashtable nameParam
protected volatile boolean finished
| Constructor Detail |
public BatchController(Vector parameters)
parameters - the parameters with which to run the simulation| Method Detail |
public void setModel(SimModel model)
setModel in interface IControllersetModel in class BaseControllermodel - the model to be controlled by this BatchControllerpublic void removeParameter(String name)
name - the name of the parameter to removepublic boolean isParameterConstant(String name)
name - the name of the Parameter
public boolean isParameter(String name)
public String getParameterValue(String name)
name - the name of the Parameter
public ArrayList getParameterNames()
public ArrayList getDynamicParameterNames()
public long getBatchCount()
public boolean doWriteHeader(String fileName)
fileName - the name of the file whose header should or should not
be written.
public void setWriteHeader(String filename,
boolean val)
filename - the name of the file whose header should or should not
be writtenval - true if the header should be written, otherwise falsepublic void onTickCountUpdate()
onTickCountUpdate in class BaseControllerpublic void begin()
public void start()
public void stopRun()
public void simEventPerformed(SimEvent evt)
SimEvent is performed. This only listens for stop
events and stops the sim when it receives the event.
public void exitSim()
IController
public boolean isBatch()
isBatch in class BaseController
|
RePast v. 2.0 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||