|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthades.simulator.EventList
EventList: time-sorted doubly-linked list for discrete-event simulation.
Nested Class Summary | |
(package private) class |
EventList.EventNode
EventNode: one node of the simulation event list. |
Field Summary | |
static boolean |
debug
|
(package private) boolean |
enable_recycling
|
long |
n_available
|
long |
n_created
|
long |
n_recycled
|
Constructor Summary | |
EventList()
constructor for an empty event list. |
Method Summary | |
boolean |
delete(EventList.EventNode victim)
delete node 'victim' from the list. |
void |
deleteAllEventsFromSource(SimObject source)
|
void |
deleteFirst()
delete the first node from the list. |
void |
first()
set the cursor to the first node of this list |
SimEvent |
getData()
get the current SimEvent (the data at the cursor EventNode) |
java.lang.String |
getName()
|
EventList.EventNode |
getRecycledNode(SimEvent event)
|
double |
getSecondEventTime()
|
double |
getSimTime()
get simulation time of the cursor node |
void |
insert(SimEvent event)
insert a new SimEvent into the list at the position corresponding to its simulation time. |
boolean |
isEmpty()
is this list empty? |
void |
last()
set the cursor to the last node of this list |
static void |
main(java.lang.String[] argv)
main(): simple self test |
static void |
message(java.lang.String msg)
|
void |
next()
move the cursor to the next node, if any |
void |
prev()
move the cursor to the previous node, if any |
java.lang.String |
printStatus()
|
void |
recycleNode(EventList.EventNode victim)
recycle an EventNode for later reuse. |
void |
setName(java.lang.String name)
|
void |
setSimTime(double t)
set simulation time of the cursor node |
java.lang.String |
toString()
Print the list. |
static void |
usage()
usage(): how to use the EventList selftest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static boolean debug
public long n_created
public long n_recycled
public long n_available
boolean enable_recycling
Constructor Detail |
public EventList()
We query the following system/user properties to enable/disable event node recycling, and the recycle-stack capacity: "Hades.Simulator.EventList.EnableRecycling" (default "true") "Hades.Simulator.EventList.RecycleCapacity" (default 500)
Method Detail |
public void setName(java.lang.String name)
public java.lang.String getName()
public final void first()
public final void last()
public final void next()
public final void prev()
public final double getSimTime()
public final void setSimTime(double t)
public final double getSecondEventTime()
public final SimEvent getData()
public EventList.EventNode getRecycledNode(SimEvent event)
public void recycleNode(EventList.EventNode victim)
public java.lang.String printStatus()
public final void insert(SimEvent event)
Because most simulation events will be scheduled near the end of the event list, we start searching from the end.
public final void deleteFirst()
public final boolean delete(EventList.EventNode victim)
public java.lang.String toString()
public final boolean isEmpty()
public void deleteAllEventsFromSource(SimObject source)
public static void message(java.lang.String msg)
public static void usage()
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |