Class EventList
java.lang.Object
eds.framework.EventList
Maintains a list of simulation events ordered by execution time.
Events are stored in a PriorityQueue and sorted according to
their natural ordering based on Event.compareTo.
The earliest event is always processed first.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
EventList
public EventList()
-
-
Method Details
-
add
Adds a new event to the event list.- Parameters:
event- the event to be added
-
remove
Removes and returns the earliest event in the list.- Returns:
- the next event to be processed, or null if the list is empty
-
getNextTime
public double getNextTime()Returns the execution time of the next event.- Returns:
- the time of the next scheduled event
- Throws:
IllegalStateException- if the event list is empty
-
isEmpty
public boolean isEmpty()Checks whether the event list is empty.- Returns:
- true if there are no events, false otherwise
-