Class AbstractRunner

java.lang.Object
repast.simphony.engine.environment.AbstractRunner
All Implemented Interfaces:
Runner, Executor<RunState>
Direct Known Subclasses:
BatchScheduleRunner, DefaultScheduleRunner, GUIScheduleRunner, InteractivBatchRunner

public abstract class AbstractRunner extends Object implements Runner
Author:
Nick Collier
  • Field Details

    • stop

      protected boolean stop
    • pause

      protected boolean pause
    • step

      protected boolean step
    • runListeners

      protected ArrayList<RunListener> runListeners
    • thread

      protected Thread thread
    • environmentBuilder

      protected RunEnvironmentBuilder environmentBuilder
    • controller

      protected Controller controller
  • Constructor Details

    • AbstractRunner

      public AbstractRunner()
  • Method Details

    • addRunListener

      public void 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.
      Specified by:
      addRunListener in interface Runner
      Parameters:
      listener - the listener to add.
    • removeRunListener

      public void removeRunListener(RunListener listener)
      Description copied from interface: Runner
      Removes the specified RunListener from the list for RunListener notified by this runner.
      Specified by:
      removeRunListener in interface Runner
    • 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

      public void setEnvironmentBuilder(RunEnvironmentBuilder environment)
      Specified by:
      setEnvironmentBuilder in interface Runner
    • 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()
      Specified by:
      init in interface Runner
    • stop

      public void stop()
      Stops the execution of the scheduled events after the any events scheduled for the current tick have been executed.
      Specified by:
      stop in interface Runner
    • step

      public void step()
      Specified by:
      step in interface Runner
    • setPause

      public void setPause(boolean pause)
      Specified by:
      setPause in interface Runner
    • 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).
      Specified by:
      go in interface Runner
      Returns:
      true if the runner should keep going
    • setController

      public void setController(Controller controller)
      Specified by:
      setController in interface Runner