SimEvent (cloudsim 3.1-SNAPSHOT API)

org.cloudbus.cloudsim.core

## Class SimEvent

- java.lang.Object
- - org.cloudbus.cloudsim.core.SimEvent

- All Implemented Interfaces:
    Cloneable, Comparable<SimEvent>

      public class SimEvent
      extends Object
      implements Cloneable, Comparable<SimEvent>

  This class represents a simulation event which is passed between the entities in the simulation.
  Author:
    Costas Simatos
  See Also:
    `Simulation`, `SimEntity`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CREATE`
    `static int` | `ENULL`
    `static int` | `HOLD_DONE`
    `static int` | `SEND`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimEvent()` Create a blank event.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Object` | `clone()` Create an exact copy of this event.
    `int` | `compareTo(SimEvent event)`
    `double` | `endWaitingTime()` Get the simulation time that this event was removed from the queue for service.
    `double` | `eventTime()` Get the simulation time that this event was scheduled.
    `Object` | `getData()` Get the data passed in this event.
    `int` | `getDestination()` Get the unique id number of the entity which received this event.
    `int` | `getSource()` Get the unique id number of the entity which scheduled this event.
    `int` | `getTag()` Get the user-defined tag of this event.
    `int` | `getType()` The internal type
    `int` | `scheduledBy()` Get the unique id number of the entity which scheduled this event.
    `void` | `setDestination(int d)` Set the destination entity of this event.
    `protected void` | `setEndWaitingTime(double end_waiting_time)` Used to set the time at which this event finished waiting in the event
    `protected void` | `setSerial(long serial)`
    `void` | `setSource(int s)` Set the source entity of this event.
    `String` | `toString()`
    `int` | `type()` Get the user-defined tag of this event

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ENULL

          public static final int ENULL

      See Also:
        Constant Field Values

    - #### SEND

          public static final int SEND

      See Also:
        Constant Field Values

    - #### HOLD_DONE

          public static final int HOLD_DONE

      See Also:
        Constant Field Values

    - #### CREATE

          public static final int CREATE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SimEvent

          public SimEvent()

      Create a blank event.

  - ### Method Detail

    - #### setSerial

          protected void setSerial(long serial)

    - #### setEndWaitingTime

          protected void setEndWaitingTime(double end_waiting_time)

      Used to set the time at which this event finished waiting in the event
      Parameters:
        `end_waiting_time` -

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getType

          public int getType()

      The internal type
      Returns:

    - #### compareTo

          public int compareTo(SimEvent event)

      Specified by:
        `compareTo` in interface `Comparable<SimEvent>`
      See Also:
        `Comparable.compareTo(Object)`

    - #### getDestination

          public int getDestination()

      Get the unique id number of the entity which received this event.
      Returns:
        the id number

    - #### getSource

          public int getSource()

      Get the unique id number of the entity which scheduled this event.
      Returns:
        the id number

    - #### eventTime

          public double eventTime()

      Get the simulation time that this event was scheduled.
      Returns:
        The simulation time

    - #### endWaitingTime

          public double endWaitingTime()

      Get the simulation time that this event was removed from the queue for service.
      Returns:
        The simulation time

    - #### type

          public int type()

      Get the user-defined tag of this event
      Returns:
        The tag

    - #### scheduledBy

          public int scheduledBy()

      Get the unique id number of the entity which scheduled this event.
      Returns:
        the id number

    - #### getTag

          public int getTag()

      Get the user-defined tag of this event.
      Returns:
        The tag

    - #### getData

          public Object getData()

      Get the data passed in this event.
      Returns:
        A reference to the data

    - #### clone

          public Object clone()

      Create an exact copy of this event.
      Overrides:
        `clone` in class `Object`
      Returns:
        The event's copy

    - #### setSource

          public void setSource(int s)

      Set the source entity of this event.
      Parameters:
        `s` - The unique id number of the entity

    - #### setDestination

          public void setDestination(int d)

      Set the destination entity of this event.
      Parameters:
        `d` - The unique id number of the entity

Copyright © 2013 The Cloud Computing and Distributed Systems (CLOUDS) Laboratory, The University of Melbourne. All Rights Reserved.