Class SimulationContext

java.lang.Object
edu.cnu.mdi.sim.SimulationContext

public final class SimulationContext extends Object
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 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