GridSim
v3.2

eduni.simjava
Class Sim_event

Object
  extended byeduni.simjava.Sim_event
All Implemented Interfaces:
Cloneable

public class Sim_event
extends Object
implements Cloneable

This class represents events which are passed between the entities in the simulation.

Version:
2.0, 11 July 2002
Author:
Costas Simatos
See Also:
Sim_system, Sim_entity

Field Summary
(package private) static int CREATE
           
(package private) static int ENULL
           
(package private) static int HOLD_DONE
           
(package private) static int SEND
           
 
Constructor Summary
  Sim_event()
          Create a blank event.
(package private) Sim_event(int evtype, double time, int src)
           
(package private) Sim_event(int evtype, double time, int src, int dest, int tag, Object edata)
           
 
Method Summary
 Object clone()
          Create an exact copy of this event.
(package private)  void copy(Sim_event ev)
           
 double end_waiting_time()
          Get the simulation time that this event was removed from the queue for service.
 double event_time()
          Get the simulation time that this event was scheduled.
 boolean from_port(Sim_port p)
          Determine if the event was sent from a given port.
 Object get_data()
          Get the data passed in this event.
 int get_dest()
          Get the unique id number of the entity which received this event.
 int get_src()
          Get the unique id number of the entity which scheduled this event.
 int get_tag()
          Get the user-defined tag of this event.
(package private)  int get_type()
           
 int scheduled_by()
          Get the unique id number of the entity which scheduled this event.
 void set_dest(int d)
          Set the destination entity of this event.
(package private)  void set_end_waiting_time(double end_waiting_time)
           
 void set_src(int s)
          Set the source entity of this event.
 int type()
          Get the user-defined tag of this event
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENULL

static final int ENULL
See Also:
Constant Field Values

SEND

static final int SEND
See Also:
Constant Field Values

HOLD_DONE

static final int HOLD_DONE
See Also:
Constant Field Values

CREATE

static final int CREATE
See Also:
Constant Field Values
Constructor Detail

Sim_event

public Sim_event()
Create a blank event. Useful for fetching events using methods such as the sim_wai() methods of entities.


Sim_event

Sim_event(int evtype,
          double time,
          int src,
          int dest,
          int tag,
          Object edata)

Sim_event

Sim_event(int evtype,
          double time,
          int src)
Method Detail

get_dest

public int get_dest()
Get the unique id number of the entity which received this event.

Returns:
the id number

get_src

public int get_src()
Get the unique id number of the entity which scheduled this event.

Returns:
the id number

event_time

public double event_time()
Get the simulation time that this event was scheduled.

Returns:
The simulation time

end_waiting_time

public double end_waiting_time()
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

scheduled_by

public int scheduled_by()
Get the unique id number of the entity which scheduled this event.

Returns:
the id number

get_tag

public int get_tag()
Get the user-defined tag of this event.

Returns:
The tag

get_data

public Object get_data()
Get the data passed in this event.

Returns:
A reference to the data

from_port

public boolean from_port(Sim_port p)
Determine if the event was sent from a given port.

Parameters:
p - The port to test
Returns:
true if the event was scheduled through the port

clone

public Object clone()
Create an exact copy of this event.

Returns:
The event's copy

set_src

public void set_src(int s)
Set the source entity of this event.

Parameters:
s - The unique id number of the entity

set_dest

public void set_dest(int d)
Set the destination entity of this event.

Parameters:
d - The unique id number of the entity

set_end_waiting_time

void set_end_waiting_time(double end_waiting_time)

get_type

int get_type()

copy

void copy(Sim_event ev)

GridSim
v3.2

The University of Melbourne, Australia, 2005