Class AbstractRunner
java.lang.Object
repast.simphony.engine.environment.AbstractRunner
- Direct Known Subclasses:
BatchScheduleRunner,DefaultScheduleRunner,GUIScheduleRunner,InteractivBatchRunner
- Author:
- Nick Collier
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Controllerprotected RunEnvironmentBuilderprotected booleanprotected ArrayList<RunListener>protected booleanprotected booleanprotected Thread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRunListener(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 voidFires a paused message to all registered run listeners.protected voidFires a restarted message to all registered run listeners.protected voidFires a started message to all registered run listeners.protected voidFires a stopped message to all registered run listeners.booleango()Specifies if the simulation should continue to run (returns true) or if it should stop (returns false).voidinit()voidremoveRunListener(RunListener listener) Removes the specified RunListener from the list for RunListener notified by this runner.voidsetController(Controller controller) voidsetEnvironmentBuilder(RunEnvironmentBuilder environment) voidsetPause(boolean pause) voidstep()voidstop()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:
addRunListenerin interfaceRunner- Parameters:
listener- the listener to add.
-
removeRunListener
Description copied from interface:RunnerRemoves the specified RunListener from the list for RunListener notified by this runner.- Specified by:
removeRunListenerin 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:
setEnvironmentBuilderin 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:RunnerSpecifies if the simulation should continue to run (returns true) or if it should stop (returns false). -
setController
- Specified by:
setControllerin interfaceRunner
-