public class DefaultModelRunner
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected ICycleProcessor |
_cycleRunner |
protected BasicModel |
_model |
protected java.util.concurrent.ExecutorService |
_service |
Constructor and Description |
---|
DefaultModelRunner(java.util.concurrent.ExecutorService service,
IModel model,
ICycleProcessor cycleRunner) |
Modifier and Type | Method and Description |
---|---|
protected double |
cycle(boolean eventsHaveFired)
run a single cycle of the model
|
protected boolean |
firePendingEvents(double now) |
protected void |
postClock(double currentSimulatedTime)
called after waitForClock returns
|
protected void |
postCycle(double nextTime)
called after each cycle
|
protected void |
postEventFiring() |
protected void |
preClock()
called before blocking on waitForClock
|
protected void |
preCycle(double currentSimulatedTime)
called before each cycle starts
|
protected void |
preEventFiring() |
void |
run() |
protected void |
runModelLoop()
run the model in loop
|
protected void |
shutDown(java.lang.Exception deferred) |
protected void |
startUp() |
protected double |
waitForClock(double waitForTime)
wait for the clock to reach this time
|
protected java.util.concurrent.ExecutorService _service
protected BasicModel _model
protected ICycleProcessor _cycleRunner
public DefaultModelRunner(java.util.concurrent.ExecutorService service, IModel model, ICycleProcessor cycleRunner)
protected void startUp()
protected void shutDown(java.lang.Exception deferred)
protected void preEventFiring()
protected boolean firePendingEvents(double now)
protected void postEventFiring()
protected double cycle(boolean eventsHaveFired)
protected double waitForClock(double waitForTime) throws java.lang.InterruptedException
waitForTime
- java.lang.InterruptedException
protected void preClock()
protected void postClock(double currentSimulatedTime)
protected void preCycle(double currentSimulatedTime)
protected void postCycle(double nextTime)
protected void runModelLoop()
clock
- public void run()
run
in interface java.lang.Runnable