avrora.sim.util
Class GlobalClock

java.lang.Object
  extended byavrora.sim.util.GlobalClock

public class GlobalClock
extends java.lang.Object

The GlobalClock class implements a global timer among multiple simulators by inserting periodic timers into each simulator.


Nested Class Summary
 class GlobalClock.InterruptedException
          How sad.
 class GlobalClock.LocalTimer
           
 
Field Summary
protected  java.lang.Object condition
           
protected  int count
           
protected  DeltaQueue eventQueue
           
protected  int goal
           
protected  double period
           
protected  java.util.HashMap threadMap
           
 
Constructor Summary
GlobalClock(double p)
           
 
Method Summary
 void add(SimulatorThread t)
           
 void addTimerEvent(Simulator.Trigger trigger, long ticks)
           
 void remove(SimulatorThread t)
           
 void removeTimerEvent(Simulator.Trigger trigger)
           
protected  void tick()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

period

protected double period

goal

protected int goal

count

protected int count

condition

protected final java.lang.Object condition

threadMap

protected final java.util.HashMap threadMap

eventQueue

protected final DeltaQueue eventQueue
Constructor Detail

GlobalClock

public GlobalClock(double p)
Method Detail

add

public void add(SimulatorThread t)

remove

public void remove(SimulatorThread t)

addTimerEvent

public void addTimerEvent(Simulator.Trigger trigger,
                          long ticks)

removeTimerEvent

public void removeTimerEvent(Simulator.Trigger trigger)

tick

protected void tick()