Package edu.cnu.mdi.sim
Class SimulationContext
java.lang.Object
edu.cnu.mdi.sim.SimulationContext
Context object shared with the simulation.
This object is safe to read from both simulation thread and EDT. The engine
owns mutation of internal bookkeeping, except for cancellation which can be
requested externally via SimulationEngine.requestCancel().
-
Method Summary
Modifier and TypeMethodDescriptiondoubleGet elapsed time since the engine started, in seconds.longGet the number of completed steps.booleanCheck whether cancellation has been requested.
-
Method Details
-
isCancelRequested
public boolean isCancelRequested()Check whether cancellation has been requested.- Returns:
- true if cancellation has been requested
-
getStepCount
public long getStepCount()Get the number of completed steps.- Returns:
- step count
-
getElapsedSeconds
public double getElapsedSeconds()Get elapsed time since the engine started, in seconds.- Returns:
- elapsed seconds
-