|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
fr.lifl.jedi.controllersCore.simulationRun.SimulationThread
public class SimulationThread
This class defines a Thread instance that runs the simulation. This class sends messages to the simulation core to tell it whenever it ends a simulation step, when the simulation aborted or ended. When a simulation step ends, the runnable instance will wait for the simulation core to notify it to continue, when all GUIs have finished updating.
JEDI V 2.2 |
Created the 3rd april 2009 |
Modified the 5th may 2009 |
Yoann Kubera |
SMAC Team (Systèmes Multi-Agents et Comportement) |
LIFL (Laboratoire d'Informatique Fondamentale de Lille) |
University of Lille, France |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
protected SimulationCore |
core
The simulation core that runs a simulation thanks to this instance. |
protected int |
currentSimulationStep
The current simulation time step. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
SimulationThread(SimulationCore core)
Constructor of this class. |
Method Summary | |
---|---|
void |
addObserver(java.util.Observer o)
|
void |
deleteObserver(java.util.Observer o)
|
int |
getCurrentSimulationStep()
Gets the current simulation step. |
void |
run()
|
void |
scheduleSingleStep()
Schedules a single simulation step. |
void |
setAbort()
Schedules the abortion of the simulation. |
void |
setPaused()
Makes sure that the simulation core will be in pause mode after performing the current time step. |
void |
setUnPaused()
Makes sure that the simulation core will no longer be in pause mode after performing the current time step. |
protected void |
step()
Performs one simulation time step. |
void |
stopWaitingForNotification()
Tells the Thread that it does not have to wait for a notification from the simulation core anymore. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SimulationCore core
protected int currentSimulationStep
Constructor Detail |
---|
public SimulationThread(SimulationCore core)
core
- The simulation core that runs a simulation thanks to this instance.Method Detail |
---|
public int getCurrentSimulationStep()
public void setPaused()
public void setUnPaused()
public void scheduleSingleStep()
public void setAbort()
public void stopWaitingForNotification()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
Runnable.run()
protected void step()
During that process, every agent will have the opportunity to initiate interactions in a particular order.
By default, this order is a random one (see RandomAgentOrderingPolicy
).
Nevertheless, this order can be redefined, thanks to the
public void addObserver(java.util.Observer o)
Observable.addObserver(java.util.Observer)
public void deleteObserver(java.util.Observer o)
Observable.deleteObserver(java.util.Observer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |