Class AbstractRunner
java.lang.Object
repast.simphony.engine.environment.AbstractRunner
- Direct Known Subclasses:
BatchScheduleRunner
,DefaultScheduleRunner
,GUIScheduleRunner
,InteractivBatchRunner
- Author:
- Nick Collier
-
Field Summary
Modifier and TypeFieldDescriptionprotected Controller
protected RunEnvironmentBuilder
protected boolean
protected ArrayList<RunListener>
protected boolean
protected boolean
protected Thread
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addRunListener
(RunListener listener) Adds the specified listener to the list of RunListener-s to be notified of any run related events, such as stopped, started, and so on.protected void
Fires a paused message to all registered run listeners.protected void
Fires a restarted message to all registered run listeners.protected void
Fires a started message to all registered run listeners.protected void
Fires a stopped message to all registered run listeners.boolean
go()
Specifies if the simulation should continue to run (returns true) or if it should stop (returns false).void
init()
void
removeRunListener
(RunListener listener) Removes the specified RunListener from the list for RunListener notified by this runner.void
setController
(Controller controller) void
setEnvironmentBuilder
(RunEnvironmentBuilder environment) void
setPause
(boolean pause) void
step()
void
stop()
Stops the execution of the scheduled events after the any events scheduled for the current tick have been executed.
-
Field Details
-
stop
protected boolean stop -
pause
protected boolean pause -
step
protected boolean step -
runListeners
-
thread
-
environmentBuilder
-
controller
-
-
Constructor Details
-
AbstractRunner
public AbstractRunner()
-
-
Method Details
-
addRunListener
Adds the specified listener to the list of RunListener-s to be notified of any run related events, such as stopped, started, and so on.- Specified by:
addRunListener
in interfaceRunner
- Parameters:
listener
- the listener to add.
-
removeRunListener
Description copied from interface:Runner
Removes the specified RunListener from the list for RunListener notified by this runner.- Specified by:
removeRunListener
in interfaceRunner
-
fireStartedMessage
protected void fireStartedMessage()Fires a started message to all registered run listeners. -
fireStoppedMessage
protected void fireStoppedMessage()Fires a stopped message to all registered run listeners. -
setEnvironmentBuilder
- Specified by:
setEnvironmentBuilder
in interfaceRunner
-
firePausedMessage
protected void firePausedMessage()Fires a paused message to all registered run listeners. -
fireRestartedMessage
protected void fireRestartedMessage()Fires a restarted message to all registered run listeners. -
init
public void init() -
stop
public void stop()Stops the execution of the scheduled events after the any events scheduled for the current tick have been executed. -
step
public void step() -
setPause
public void setPause(boolean pause) -
go
public boolean go()Description copied from interface:Runner
Specifies if the simulation should continue to run (returns true) or if it should stop (returns false). -
setController
- Specified by:
setController
in interfaceRunner
-