public class SimulationController
extends java.lang.Thread
SimulationController
is determined
to be the entity which initiates the simulation flow. That is:
Simulation.progress()
GUI
when to do so
SimulationStates
in
SimulationRun
Modifier and Type | Field and Description |
---|---|
static SimulationController |
controller |
SimulationState |
currentState |
static double |
simulationIntervalDuration
How long a simulation step takes for those objects.
|
static long |
simulationRecalculationInterval
How fast the simulation is recalculated in real time.
|
Modifier | Constructor and Description |
---|---|
protected |
SimulationController(SimulationMode simulationMode) |
Modifier and Type | Method and Description |
---|---|
static boolean |
isRunning() |
void |
run() |
static SimulationController |
setRunning(boolean running,
SimulationMode simulationMode,
double timeLimit) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static SimulationController controller
public SimulationState currentState
public static double simulationIntervalDuration
CollisionPanzerPanzer.react
)public static long simulationRecalculationInterval
protected SimulationController(SimulationMode simulationMode)
public static boolean isRunning()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public static SimulationController setRunning(boolean running, SimulationMode simulationMode, double timeLimit)
running
- true
- SimulationRun
is
proceeded from the most current SimulationState
and will do so until stopped. If there was not already one, a
SimulationController
is instantiated and set
running.
false
- stops appending
SimulationRun
with ever new
SimulationState
s.
simulationMode
- - only relevant if running
timeLimit
- - after how many seconds the simulation
is to be stopped automaticallySimulationController
,
if instantiated.