SimKit
Class Event

java.lang.Object
  |
  +--SimKit.Event

public class Event
extends java.lang.Object

The Event class represents a simulation event (or message). LPs communicate with each other by sending Events back and forth. An Event is essentially a message sent from a source LP to a destination LP.
Although users should derive specific event types from this class, they may still use the class on its own for generic events.

Extending this class ...
This class has no abstract methods.

See Also:
LP, Simulation

Field Summary
protected  LP fDestLP
          The LP to which this event is destined.
protected  double fRecvTime
          The simulation time the event was received.
protected  double fSendTime
          The simulation time the event was sent.
protected  LP fSrcLP
          The LP from which this event came.
 
Constructor Summary
Event()
          The Event constructor.
 
Method Summary
 LP destinationLP()
          The destination LP is set when send_and_delete is called.
 double recvTime()
          The receive time is set when send_and_delete is called.
 void send_and_delete(LP destLP, double recvTime)
          Schedule a message for execution by an LP at a specific simulation time.
 double sendTime()
          Report the time the event was sent.
 void setDestLP(LP destination)
          Set the destination LP of the event.
 LP sourceLP()
          The source LP is set when send_and_delete is called.
 java.lang.String toString()
          Returns a string with this Event's unique ID number, source LP, sendtime receivetime and destination LP.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fSendTime

protected double fSendTime
The simulation time the event was sent.


fRecvTime

protected double fRecvTime
The simulation time the event was received.


fDestLP

protected LP fDestLP
The LP to which this event is destined.


fSrcLP

protected LP fSrcLP
The LP from which this event came.

Constructor Detail

Event

public Event()
The Event constructor. This constructor generates a unique ID for the event.

Method Detail

send_and_delete

public void send_and_delete(LP destLP,
                            double recvTime)
Schedule a message for execution by an LP at a specific simulation time. IMPORTANT NOTE: Once this method has been called the Event is no longer accessable by the source LP. The source LP should not modify the Event object at all after this message has been sent.

Parameters:
destLP - The LP to which the event is going to be sent
recvTime - The simulation time when the event is scheduled to execute.

sendTime

public final double sendTime()
Report the time the event was sent.

Returns:
The simulation time at which this event was sent.

recvTime

public final double recvTime()
The receive time is set when send_and_delete is called.

Returns:
The simulation time this event is scheduled for.

destinationLP

public final LP destinationLP()
The destination LP is set when send_and_delete is called. This can only be called from the dest LP so its really equivalent to SK_Simulation.currLP() and should be eliminated.

Returns:
The LP that is to execute this Event.

sourceLP

public final LP sourceLP()
The source LP is set when send_and_delete is called.

Returns:
The LP from which this event was sent.

setDestLP

public void setDestLP(LP destination)
Set the destination LP of the event. Is this needed???


toString

public java.lang.String toString()
Returns a string with this Event's unique ID number, source LP, sendtime receivetime and destination LP. Note: Depending on when this is called, some of these values will not have been set yet. Only after invocation of send_and_delete will all of the member data be set.

Overrides:
toString in class java.lang.Object
Returns:
str A descriptive string for this event.