engine
Class Time

java.lang.Object
  |
  +--engine.Time

class Time
extends java.lang.Object

The main thread of the simulation & the time manager.


Field Summary
(package private) static java.util.Vector afterFinish
          Contains a list of instructions to execute after each time unit
(package private) static boolean anyThreads
           
(package private) static java.util.Vector controlThreads
           
(package private) static java.util.Vector finishList
          The stuff pending to the end of the time units, time - ordered ;
(package private) static boolean keepWorking
          make it false to stop the simulation
(package private) static java.util.Vector lastFinisher
          The stuff pending to the end of the time units, time - ordered ;
(package private)  boolean stop
           
(package private) static long time
          Holds the start time of the simulation, for cronometration purpose
(package private) static int time_2
           
 
Constructor Summary
(package private) Time()
           
 
Method Summary
static void addAfterFinish(Executable i)
           
static void addFinisher(Instruction i)
          Appends an instruction for the end of the current time unit.
static void addFinisher(int delay, Instruction i)
          Appends an instruction for the end of the oClock() + delay time unit.
static long clk2()
           
static long oClock()
           
(package private) static void removeThread(java.lang.Thread t)
           
(package private) static void runSimulation()
          the main simulation loop
(package private) static void startSimulation()
          starts all the threads
(package private) static void stopSimulation()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

time

static long time
Holds the start time of the simulation, for cronometration purpose

time_2

static int time_2

controlThreads

static java.util.Vector controlThreads

lastFinisher

static java.util.Vector lastFinisher
The stuff pending to the end of the time units, time - ordered ;

finishList

static java.util.Vector finishList
The stuff pending to the end of the time units, time - ordered ;

afterFinish

static java.util.Vector afterFinish
Contains a list of instructions to execute after each time unit

anyThreads

static boolean anyThreads

keepWorking

static boolean keepWorking
make it false to stop the simulation

stop

boolean stop
Constructor Detail

Time

Time()
Method Detail

startSimulation

static void startSimulation()
starts all the threads

oClock

public static long oClock()

clk2

public static long clk2()

addFinisher

public static void addFinisher(int delay,
                               Instruction i)
Appends an instruction for the end of the oClock() + delay time unit.

addFinisher

public static void addFinisher(Instruction i)
Appends an instruction for the end of the current time unit.

addAfterFinish

public static void addAfterFinish(Executable i)

removeThread

static void removeThread(java.lang.Thread t)

stopSimulation

static void stopSimulation()

runSimulation

static void runSimulation()
the main simulation loop