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
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getData()
Gets the data object passed in this event.Gets the entity which received this event.double
Gets the simulation time that this event was removed from the queue for service.int
Gets the priority of this event.long
Gets the serial number that defines the order of received events when multiple events are generated at the same time.Gets the CloudSim instance that represents the simulation for with the Entity is related to.Gets the entity which scheduled this event.getTag()
Gets the tag that classifies this event.getType()
Gets the internal typesetDestination
(SimEntity destination) Sets the destination entity of this event, that defines its destination.void
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
An attribute that implements the Null Object Design Pattern forSimEvent
objects.
-
-
Method Details
-
setSimulation
Sets the simulation the event belongs to- Parameters:
simulation
- the simulation instance to set- Returns:
-
getType
SimEvent.Type getType()Gets the internal type- Returns:
-
getDestination
SimEntity getDestination()Gets the entity which received this event.- Returns:
-
getSource
SimEntity getSource()Gets the entity which scheduled this event.- Returns:
-
getEndWaitingTime
double getEndWaitingTime()Gets the simulation time that this event was removed from the queue for service.- Returns:
-
getTag
CloudSimTag getTag()Gets 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 defined from a constant value defined inCloudSimTag
.- Returns:
-
getPriority
int getPriority()Gets the priority of this event. Negative values indicates higher priority.- Returns:
-
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 is the class of the data associated to the event. After checking what is the event tag, te destination entity can perform a typecast to convert the data to the expected class.- Returns:
- a reference to the data object
-
setSource
Sets the source entity of this event, that defines its sender.- Parameters:
source
- the unique id number of the source entity- Returns:
-
setDestination
Sets the destination entity of this event, that defines its destination.- Parameters:
destination
- the unique id number of the destination entity- Returns:
-
getSerial
long getSerial()Gets 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 other (i.e. that happens after other), thecompareTo(SimEvent)
makes use of this field.- Returns:
-
setSerial
void setSerial(long serial) 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()Gets the CloudSim instance that represents the simulation for with the Entity is related to.- Returns:
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SimEvent>
-