Class SimEvent

java.lang.Object
  extended by SimEvent
All Implemented Interfaces:
Comparable<SimEvent>

public class SimEvent
extends Object
implements Comparable<SimEvent>

SimulationEvent (SimEvent) -- an event that occurs in a simulation, like a truck arriving at a factory, or a salesperson leaving the market

Author:
Mark Guzdial, Barb Ericson

Constructor Summary
SimEvent()
          Constructor that takes no arguments
SimEvent(DEAgent moi, double scheduledTime, int eventType)
          Constructor that takes values for all the fields
 
Method Summary
 int compareTo(SimEvent other)
          Method to compare to another simulation event
 DEAgent getAgent()
          Method to get the discrete event agent
 int getMessage()
          Method to get the message
 double getTime()
          Method to get the time the event occurs
 void setMessage(int newMsg)
          Method to set the message
 void setTime(double myTime)
          Method to set the time that the event occurs myTime the time to use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimEvent

public SimEvent(DEAgent moi,
                double scheduledTime,
                int eventType)
Constructor that takes values for all the fields

Parameters:
moi - the agent
scheduledTime - the event time
eventType - the event type

SimEvent

public SimEvent()
Constructor that takes no arguments

Method Detail

compareTo

public int compareTo(SimEvent other)
Method to compare to another simulation event

Specified by:
compareTo in interface Comparable<SimEvent>
Returns:
pos if this is greater, 0 if they are equal and negative if this is less than the other

getTime

public double getTime()
Method to get the time the event occurs

Returns:
the time the event occurs

setTime

public void setTime(double myTime)
Method to set the time that the event occurs myTime the time to use


getMessage

public int getMessage()
Method to get the message

Returns:
the message

setMessage

public void setMessage(int newMsg)
Method to set the message

Parameters:
newMsg - the new message to use

getAgent

public DEAgent getAgent()
Method to get the discrete event agent

Returns:
the discrete event agent