|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.sim.clock.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 events to be fired
some number of clock cycles after the previous link.
Field Summary | |
protected long |
count
The count field stores the total number of cycles that this queue has been advanced, i.e.
|
protected avrora.sim.clock.DeltaQueue.EventList |
freeEventLists
The freeEventLists field stores a reference to any free event links that have become
unused during the processing of events. |
protected avrora.sim.clock.DeltaQueue.Link |
freeLinks
The freeLinks field stores a reference to any free links that have become unused during
the processing of events. |
protected avrora.sim.clock.DeltaQueue.Link |
head
The head field stores a reference to the head of the delta queue, which represents the
event that is nearest in the future. |
Constructor Summary | |
DeltaQueue()
|
Method Summary | |
void |
advance(long cycles)
The advance method advances timesteps through the queue by the specified number of clock
cycles, processing any events. |
long |
getCount()
The getCount() gets the total cumulative count of all the advance() calls on
this delta queue. |
long |
getFirstEventTime()
The getHeadDelta() method gets the number of clock cycles until the first event will
fire. |
void |
insertEvent(Simulator.Event t,
long cycles)
The add method adds an event to be executed in the future. |
void |
removeEvent(Simulator.Event e)
The remove method removes all occurrences of the specified event within the delta queue. |
void |
skipAhead()
The skipAhead() method skips ahead to the next event in the queue and fires it. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected avrora.sim.clock.DeltaQueue.Link head
head
field stores a reference to the head of the delta queue, which represents the
event that is nearest in the future.
protected avrora.sim.clock.DeltaQueue.Link freeLinks
freeLinks
field stores a reference to any free links that have become unused during
the processing of events. A free list is used to prevent garbage from accumulating.
protected avrora.sim.clock.DeltaQueue.EventList freeEventLists
freeEventLists
field stores a reference to any free event links that have become
unused during the processing of events. A free list is used to prevent garbage from accumulating.
protected long count
count
field stores the total number of cycles that this queue has been advanced, i.e.
the sum of all advance()
calls.
Constructor Detail |
public DeltaQueue()
Method Detail |
public void insertEvent(Simulator.Event t, long cycles)
add
method adds an event to be executed in the future.
t
- the event to addcycles
- the number of clock cycles in the futurepublic void removeEvent(Simulator.Event e)
remove
method removes all occurrences of the specified event within the delta queue.
e
- the event to removepublic void advance(long cycles)
advance
method advances timesteps through the queue by the specified number of clock
cycles, processing any events.
cycles
- the number of clock cycles to advancepublic void skipAhead()
skipAhead()
method skips ahead to the next event in the queue and fires it.
public long getFirstEventTime()
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 |