Class Simulator.SimulatorWorkerThread
java.lang.Object
java.lang.Thread
nl.tudelft.simulation.dsol.simulators.Simulator.SimulatorWorkerThread
- All Implemented Interfaces:
Runnable
- Enclosing class:
- Simulator<T extends Number & Comparable<T>>
The worker thread to execute the run() method of the Simulator and to start/stop the simulation.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ModifierConstructorDescriptionprotected
SimulatorWorkerThread
(String name, Simulator<?> job) constructs a new SimulatorRunThread. -
Method Summary
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
SimulatorWorkerThread
constructs a new SimulatorRunThread.- Parameters:
name
- String; the name of the threadjob
- Runnable; the job to run
-
-
Method Details
-
cleanUp
public void cleanUp()Clean up the worker thread. synchronized method, otherwise it does not own the Monitor on the wait. -
isRunning
public boolean isRunning()- Returns:
- whether the run method of the job is running or not
-
isWaiting
public boolean isWaiting()- Returns:
- whether the thread is in the waiting state
-
run
public void run()
-