SimEvent

public interface SimEvent extends Comparable<SimEvent>, EventInfo

Represents a simulation event which is passed between the entities in a specific Simulation instance.

Author:Costas Simatos, Manoel Campos da Silva Filho

See also: CloudSimEvent

Fields

NULL

SimEvent NULL

An attribute that implements the Null Object Design Pattern for SimEvent objects.

Methods

compareTo

int compareTo(SimEvent evt)

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 then can perform a typecast to convert the data to the expected class.

Returns:a reference to the data object

getDestination

SimEntity getDestination()

Gets the entity which received this event.

getEndWaitingTime

double getEndWaitingTime()

Gets the simulation time that this event was removed from the queue for service.

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.

getSimulation

Simulation getSimulation()

Gets the CloudSim instance that represents the simulation for with the Entity is related to.

getSource

SimEntity getSource()

Gets the entity which scheduled this event.

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 in CloudSimTags.

getType

Type getType()

Gets the internal type

scheduledBy

SimEntity scheduledBy()

Gets the entity which scheduled this event.

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

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

setSimulation

SimEvent setSimulation(Simulation simulation)

Sets the simulation the event belongs to

Parameters:
  • simulation – the simulation instance to set

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