Class Event
java.lang.Object
eds.framework.Event
- All Implemented Interfaces:
Comparable<Event>
Represents a simulation event.
An Event contains a type of event, the simulation time at which it occurs,
and the related simulation entity. Events are comparable by time and are
stored in a priority queue.
-
Constructor Summary
ConstructorsConstructorDescriptionEvent(IEventType type, double time, ISimulationEntity entity) Creates a new Event. -
Method Summary
-
Constructor Details
-
Event
Creates a new Event.- Parameters:
type- the type of the eventtime- the simulation time when the event occursentity- the simulation entity associated with the event
-
-
Method Details
-
getType
-
getTime
public double getTime()Returns the simulation time of the event.- Returns:
- event execution time
-
getEntity
Returns the simulation entity associated with this event.- Returns:
- the related simulation entity
-
compareTo
Compares this event with another event based on time. Used for ordering events in a priority queue.- Specified by:
compareToin interfaceComparable<Event>- Parameters:
other- the event to compare with- Returns:
- a negative integer, zero, or a positive integer as this event time is less than, equal to, or greater than the specified event time
-