java.lang.Object
org.bzdev.devqsim.SimulationMonitor<S>
- Type Parameters:
S
- the type of a subclass ofSimulation
- Direct Known Subclasses:
Animation2DMonitor
,DramaSimMonitor
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected S
Get the simulationabstract boolean
Determines if a simulation should pause.
-
Constructor Details
-
SimulationMonitor
public SimulationMonitor()Constructor. This construct does not allow the use of simulation methods. -
SimulationMonitor
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
Get the simulation- Returns:
- the simulation
-