|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--cad.simcad.worldsimulator.engine.CoreTimeMaster
An implementation of Simulator.
| Field Summary | |
int |
_maxTimeStep
|
int |
_minTimeStep
|
int |
_simTimeStep
|
int |
_stepIncrement
|
long |
_turnCount
|
protected java.lang.Thread |
loop
|
protected int |
simDONE
|
protected int |
simEXIT
|
protected int |
simINIT
|
protected int |
simPAUSE
|
protected int |
simRUN
|
protected int |
simSTART
|
protected IntegerSemaphor |
simState
Stores the state of the simulation {running, paused} |
protected int |
simSTOP
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
CoreTimeMaster(SimEnvironment simEnv,
SimViewer sv)
Creates new CoreTimeMaster |
|
| Method Summary | |
void |
continueSimulation()
Signals the simulation engine to continue the simulation. |
boolean |
decreaseSpeed()
Signals the simulation to decrease the speed at which time is ticking. |
void |
exitSimulation()
Signals the simulation engine to quit the simulation. |
int |
getTimeStep()
Return the time for a simulation turn |
long |
getTurnCount()
Return the turn counter value of the Simulator |
boolean |
increaseSpeed()
Signals the simulation to increase the speed at which time is ticking. |
void |
pauseSimulation()
Signals the simulation engine to pause the simulation. |
void |
run()
This is the Thread-main-loop, that calls invokes one simulation cycle when necessary. |
void |
setSimViewer(SimViewer sv)
Set the SimViewer for this Simulator |
void |
simulateCycle()
this method does the complete simulation of one "game" or situation until the evaluation function determines the target condition to be reached. |
void |
simulateStep()
does one step of the simulation. |
void |
startSimulation()
Signals the simulation engine to start the simulation. |
void |
stopSimulation()
Signals the simulation engine to stop the simulation. |
void |
updateView()
Here the visualisation of the simulation is updated. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 java.lang.Thread loop
protected IntegerSemaphor simState
public long _turnCount
public int _simTimeStep
public int _maxTimeStep
public int _minTimeStep
public int _stepIncrement
protected final int simINIT
protected final int simSTART
protected final int simRUN
protected final int simPAUSE
protected final int simDONE
protected final int simSTOP
protected final int simEXIT
| Constructor Detail |
public CoreTimeMaster(SimEnvironment simEnv,
SimViewer sv)
| Method Detail |
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void startSimulation()
startSimulation in interface Simulatorpublic void pauseSimulation()
pauseSimulation in interface Simulatorpublic void continueSimulation()
continueSimulation in interface Simulatorpublic void stopSimulation()
stopSimulation in interface Simulatorpublic void exitSimulation()
exitSimulation in interface Simulatorpublic boolean increaseSpeed()
increaseSpeed in interface Simulatorpublic boolean decreaseSpeed()
decreaseSpeed in interface Simulatorpublic void updateView()
public void simulateCycle()
public void setSimViewer(SimViewer sv)
Simulator
setSimViewer in interface Simulatorsv - A SimViewer objectpublic long getTurnCount()
Simulator
getTurnCount in interface Simulatorpublic int getTimeStep()
Simulator
getTimeStep in interface Simulatorpublic void simulateStep()
isPossibleCollision-method of class
SimObject.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||