Class SimulationMonitor<S extends Simulation>

java.lang.Object
org.bzdev.devqsim.SimulationMonitor<S>
Type Parameters:
S - the type of a subclass of Simulation
Direct Known Subclasses:
Animation2DMonitor, DramaSimMonitor

public abstract class SimulationMonitor<S extends Simulation> extends Object
Determine when a simulation should pause. Instances of this class can be used to determine when a simulation should pause, based on user-defined criteria. When passed as an argument to Simulation.run(SimulationMonitor), the simulation loop will call simulationPauses() once per iteration, and will terminate if simulationPauses() returns true.
  • Constructor Details

    • SimulationMonitor

      public SimulationMonitor()
      Constructor. This construct does not allow the use of simulation methods.
    • SimulationMonitor

      public SimulationMonitor(S sim)
      Constructor with simulation. The use of this method allows the method simulationPauses() to use various simulation methods (e.g., to look up specific objects by name).
      Parameters:
      sim - the simulation
  • Method Details

    • simulationPauses

      public abstract boolean simulationPauses()
      Determines if a simulation should pause. or not.
      Returns:
      true if the simulation should pause; false otherwise
    • getSimulation

      protected S getSimulation()
      Get the simulation
      Returns:
      the simulation