|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuchicago.src.sim.engine.BaseController
uchicago.src.sim.engine.ThinController
public class ThinController
Provides minimal (thin) controller support for running a simulation. ThinController is intended to provide batch-like non-gui programmatic control over a simulation for those who want to do batch type runs without using RePast's batch run mechansim. Thin controller thus provides methods to start, stop, pause and exit a simulation, but virtually nothing else. In particular loading parameters into a model is not done here. Loading parameters using some sort of custom parameter file or mechanism will have to be done elsewhere.
ThinController can be used in conjuntion with a tool like Drone (drone.sf.net) where an instance of the model and a controller are created for each run of the model. The main method of a model might then look like:
public static void main( String[] args ) {
MyModel model = new MyModel();
ThinController controller = new ThinController();
model.setController(controller);
controller.setExitOnExit(true);
controller.setModel(model);
model.addSimEventListener(controller);
// custom parameter loading here ...
...
control.startSimulation();
}
| Field Summary | |
|---|---|
protected boolean |
isGui
|
| Fields inherited from class uchicago.src.sim.engine.BaseController |
|---|
done, doStep, executeBegin, exitOnExit, go, listenerList, model, monitor, params, pauseActionsExecuted, pauseAt, pauseAtAction, pauseSim, persistentObj, runFinished, runThread, schedule, simRun, sleepValue, time |
| Constructor Summary | |
|---|---|
ThinController(boolean isGui)
Creates a ThinController, specifying whether this is a graphical controller or not. |
|
| Method Summary | |
|---|---|
void |
exitSim()
Exits a simulation. |
long |
getRunCount()
Always returns 1. |
boolean |
isBatch()
Returns true if this ThinController is a batch controller. |
boolean |
isGUI()
Returns true if this ThinController is a gui controller. |
protected void |
onTickCountUpdate()
Called whenever the tick count is incremented. |
void |
simEventPerformed(SimEvent evt)
Listens for SimEvents and responds accordingly. |
| Methods inherited from class uchicago.src.sim.engine.BaseController |
|---|
addSimEventListener, beginModel, fireSimEvent, getCellDepth, getCellHeight, getCellWidth, getCurrentTime, getDefaultModelParameters, getExitOnExit, getModel, getModelParameters, getPauseAt, getPersistentObj, getRandomSeed, getSchedule, notifyMonitor, pauseSim, putPersistentObj, removeSimEventListener, setCellDepth, setCellHeight, setCellWidth, setExitOnExit, setModel, 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 boolean isGui
| Constructor Detail |
|---|
public ThinController(boolean isGui)
isGui - whether or not this ThinController will identify itself as
a gui controller or not| Method Detail |
|---|
public void exitSim()
protected void onTickCountUpdate()
BaseController
onTickCountUpdate in class BaseControllerpublic void simEventPerformed(SimEvent evt)
evt - public boolean isGUI()
public boolean isBatch()
isBatch in interface IControllerisBatch in class BaseControllerpublic long getRunCount()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||