|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.sim.util.DeltaQueue
The DeltaQueue class implements an amortized constant time
delta-queue for processing of scheduled events. Events are put into the queue
that will fire at a given number of cycles in the future. An internal delta
list is maintained where each link in the list represents a set of triggers
to be fired some number of clock cycles after the previous link.
| Field Summary | |
protected long |
count
|
protected avrora.sim.util.DeltaQueue.Link |
freeLinks
|
protected avrora.sim.util.DeltaQueue.TriggerLink |
freeTriggerLinks
|
protected avrora.sim.util.DeltaQueue.Link |
head
|
| Constructor Summary | |
DeltaQueue()
|
|
| Method Summary | |
void |
add(Simulator.Trigger t,
long cycles)
The add method adds a trigger to be executed in the future. |
void |
advance(long cycles)
The advance method advances timesteps through the queue by the
specified number of clock cycles, processing any triggers. |
long |
getCount()
The getCount() gets the total cumulative count of all the
advance() calls on this delta queue. |
long |
getHeadDelta()
The getHeadDelta() method gets the number of clock cycles until
the first event will fire. |
void |
remove(Simulator.Trigger e)
The remove method removes all occurrences of the specified
trigger within the delta queue. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected avrora.sim.util.DeltaQueue.Link head
protected avrora.sim.util.DeltaQueue.Link freeLinks
protected avrora.sim.util.DeltaQueue.TriggerLink freeTriggerLinks
protected long count
| Constructor Detail |
public DeltaQueue()
| Method Detail |
public void add(Simulator.Trigger t,
long cycles)
add method adds a trigger to be executed in the future.
t - the trigger to firecycles - the number of clock cycles in the futurepublic void remove(Simulator.Trigger e)
remove method removes all occurrences of the specified
trigger within the delta queue.
e - the trigger to removepublic void advance(long cycles)
advance method advances timesteps through the queue by the
specified number of clock cycles, processing any triggers.
cycles - the number of clock cycles to advancepublic long getHeadDelta()
getHeadDelta() method gets the number of clock cycles until
the first event will fire.
public long getCount()
getCount() gets the total cumulative count of all the
advance() calls on this delta queue.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||