Interface SimEvent
- All Superinterfaces:
Comparable<SimEvent>
,EventInfo
- All Known Implementing Classes:
CloudSimEvent
public interface SimEvent extends Comparable<SimEvent>, EventInfo
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:
CloudSimEvent
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
SimEvent.Type
Internal event types -
Field Summary
-
Method Summary
Modifier and Type Method Description int
compareTo(SimEvent evt)
Object
getData()
Gets the data object passed in this event.SimEntity
getDestination()
Gets the entity which received this event.double
getEndWaitingTime()
Gets the simulation time that this event was removed from the queue for service.long
getSerial()
Gets the serial number that defines the order of received events when multiple events are generated at the same time.Simulation
getSimulation()
Gets the CloudSim instance that represents the simulation for with the Entity is related to.SimEntity
getSource()
Gets the entity which scheduled this event.int
getTag()
Gets the user-defined tag of this event.SimEvent.Type
getType()
Gets the internal typeSimEntity
scheduledBy()
Gets the entity which scheduled this event.SimEvent
setDestination(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.SimEvent
setSimulation(Simulation simulation)
Sets the simulation the event belongs toSimEvent
setSource(SimEntity source)
Sets 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:
-
scheduledBy
SimEntity scheduledBy()Gets the entity which scheduled this event.- Returns:
-
getTag
int getTag()Gets the user-defined tag of 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 inCloudSimTags
.- 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 then 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>
-