simulator
Class Event

java.lang.Object
  |
  +--simulator.Event
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DisablesEvent, EnablesEvent, ExecuteEvent, FacilitatesEvent, HindersEvent, MessageEvent, ReactionEvent, ResourceEvent

public abstract class Event
extends java.lang.Object
implements java.io.Serializable

Module: simulator

Copyright: UMASS - MASL 1998

Version:
$version$
Author:
Bryan Horling, (bhorling@cs.umass.edu)

Description: An object containing the information which describes a particular event.

See Also:
Serialized Form

Constructor Summary
Event(int s, int e)
          Constructor, this sets up the event and automatically gives it a unique numerical id.
 
Method Summary
 void abort(java.lang.String a)
          Abort an event before the specified time
 void addProducedResource(Resources r)
          Add Resources Produces by this Event()
 void addUsedResource(Resources r)
          Add Resources Uses by this Event()
 java.lang.String asString()
          Returns the event as a string
 void delay(int d)
          Delays the start time
 void extend(int e)
          Extends the execution time
 void freeProducedResource(Resources res)
          Freeying resources uses by an Event()
 void freeProducedResources()
          Freeying resources uses by an Event()
 void freeUsedResource(Resources res)
          Freeying resources uses by an Event()
 void freeUsedResources()
          Freeying resources uses by an Event()
 java.awt.Label getDisplay()
          Returns the current display of the event
 int getFinish()
          Returns the expected finish time
 long getID()
          Gets the event's ID number
 int getStart()
          Returns the expected start time
abstract  java.lang.String getStatus()
          Returns the current status of the event
 void overloadResources(java.lang.String resource, float value)
          In case of overloading this will uses the limits NLE's
abstract  boolean realize()
          Realizes the particular event
 long stateCode()
          Returns the state code, which should hopefully be relatively unique (based on the event's contents) and deterministic
 void updateDisplay()
          Updates the status display
 void updateProducedResources()
          Updating at each pulse the resources produced by this Event()
 void updateUsedResources()
          Updating at each pulse the resources used by this Event()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Event

public Event(int s,
             int e)
Constructor, this sets up the event and automatically gives it a unique numerical id.
Parameters:
s - The start time (offset from current time)
e - The execution time
Method Detail

delay

public void delay(int d)
Delays the start time
Parameters:
d - The delay time

extend

public void extend(int e)
Extends the execution time
Parameters:
e - The extend time

getID

public long getID()
Gets the event's ID number
Returns:
The ID number

getStart

public int getStart()
Returns the expected start time
Returns:
The start time

getFinish

public int getFinish()
Returns the expected finish time
Returns:
The finish time

abort

public void abort(java.lang.String a)
Abort an event before the specified time

addUsedResource

public void addUsedResource(Resources r)
Add Resources Uses by this Event()

addProducedResource

public void addProducedResource(Resources r)
Add Resources Produces by this Event()

freeUsedResources

public void freeUsedResources()
Freeying resources uses by an Event()

freeUsedResource

public void freeUsedResource(Resources res)
Freeying resources uses by an Event()

freeProducedResources

public void freeProducedResources()
Freeying resources uses by an Event()

freeProducedResource

public void freeProducedResource(Resources res)
Freeying resources uses by an Event()

overloadResources

public void overloadResources(java.lang.String resource,
                              float value)
In case of overloading this will uses the limits NLE's

updateUsedResources

public void updateUsedResources()
Updating at each pulse the resources used by this Event()

updateProducedResources

public void updateProducedResources()
Updating at each pulse the resources produced by this Event()

getStatus

public abstract java.lang.String getStatus()
Returns the current status of the event
Returns:
A String representing the event status

updateDisplay

public void updateDisplay()
Updates the status display

getDisplay

public java.awt.Label getDisplay()
Returns the current display of the event
Returns:
A component which is the display

realize

public abstract boolean realize()
Realizes the particular event
Returns:
True if the realization was successfull

stateCode

public long stateCode()
Returns the state code, which should hopefully be relatively unique (based on the event's contents) and deterministic
Returns:
the state code

asString

public java.lang.String asString()
Returns the event as a string
Returns:
The stringified version of the event