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:
  • Field Details

    • NULL

      static final SimEvent NULL
      An attribute that implements the Null Object Design Pattern for SimEvent objects.
  • Method Details

    • setSimulation

      SimEvent setSimulation(Simulation simulation)
      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 the CloudSimTag or 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 the getTag() 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

      SimEvent setSource(SimEntity source)
      Sets the source entity of this event that defines its sender.
      Parameters:
      source - the source entity
    • setDestination

      SimEvent setDestination(SimEntity destination)
      Sets the destination entity of this event that defines its destination.
      Parameters:
      destination - the destination entity
    • 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 same getTag(), to know what event is greater than another (i.e., that happens after other), the compareTo(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

      SimEvent 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()
      Returns:
      the CloudSimPlus instance that represents the simulation for with the Entity is related to.
    • compareTo

      int compareTo(SimEvent evt)
      Specified by:
      compareTo in interface Comparable<SimEvent>