Interface SimEvent
- All Superinterfaces:
Comparable<SimEvent>,EventInfo
- All Known Implementing Classes:
CloudSimEvent
Represents a simulation event which is passed between the entities
in a specific
Simulation instance.- Since:
- CloudSim Plus 1.0
- Author:
- Costas Simatos, Manoel Campos da Silva Filho
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintgetData()Gets the data object passed in this event.doublelongReturns the serial number that defines the order of received events when multiple events are generated at the same time.intgetTag()Returns the tag that classifies this event.getType()setDestination(SimEntity destination) Sets the destination entity of this event that defines its destination.setSerial(long serial) Sets the serial number that defines the order of received events when multiple events are generated at the same time.setSimulation(Simulation simulation) Sets the simulation the event belongs toSets the source entity of this event that defines its sender.Methods inherited from interface org.cloudsimplus.listeners.EventInfo
getListener, getTime
-
Field Details
-
NULL
-
-
Method Details
-
setSimulation
Sets the simulation the event belongs to- Parameters:
simulation- the simulation instance to set
-
getType
SimEvent.Type getType()- Returns:
- the internal type
-
getDestination
SimEntity getDestination()- Returns:
- the entity which received this event.
-
getSource
SimEntity getSource()- Returns:
- the entity which scheduled this event.
-
getEndWaitingTime
double getEndWaitingTime()- Returns:
- the simulation time that this event was removed from the queue for service.
-
getTag
int getTag()Returns the tag that classifies this event. The meaning of such a tag depends on the entities that generate and receive the event. Usually it is a constant value from theCloudSimTagor some custom tag defined by new classes.- Returns:
- the tag that classifies this event
-
getData
Object getData()Gets the data object passed in this event. The actual class of this data is defined by the entity that generates the event. The value defined for thegetTag()is used by an entity receiving the event to know what the class of the data associated with the event is. After checking the event tag, the destination entity can perform typecast to convert the data to the expected class.- Returns:
- a reference to the data object
-
setSource
-
setDestination
-
getSerial
long getSerial()Returns the serial number that defines the order of received events when multiple events are generated at the same time. If two events have the samegetTag(), to know what event is greater than another (i.e., that happens after other), thecompareTo(SimEvent)makes use of this field.- Returns:
- the serial number that defines the order of received events when multiple events are generated at the same time
-
setSerial
Sets the serial number that defines the order of received events when multiple events are generated at the same time.- Parameters:
serial- the serial value to set
-
getSimulation
Simulation getSimulation()- Returns:
- the
CloudSimPlusinstance that represents the simulation for with the Entity is related to.
-
compareTo
- Specified by:
compareToin interfaceComparable<SimEvent>
-