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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Internal event types
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SimEvent
    An attribute that implements the Null Object Design Pattern for SimEvent objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    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.
    Gets the tag that classifies this event.
    Gets the internal type
    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.
    Sets the simulation the event belongs to
    Sets the source entity of this event, that defines its sender.

    Methods inherited from interface org.cloudsimplus.listeners.EventInfo

    getListener, getTime
  • 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
      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 in CloudSimTag.
      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 the getTag() 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

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

      SimEvent setDestination(SimEntity destination)
      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 same getTag(), to know what event is greater than other (i.e. that happens after other), the compareTo(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

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