All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simulation.events.Event

java.lang.Object
   |
   +----simulation.events.Event

public abstract class Event
extends java.lang.Object
The base class from which the classes TimeEvent and StateEvent are inherited.

Class TimeEvent is used to describe the time events of a model, i.e., those events scheduled to occur at specified points in time.

Class StateEvent is used to describe the state events of a model, i.e., those events scheduled to occur to occur when the state of the system fulfills a specified condition.

The actions method is used to describe the actions associated with a class of events. When an event occurs, its action are executed.

See Also:
simulation.events.TimeEvent, simulation.events.StateEvent, simulation.events.Simulation

Constructor Index

 o Event()

Method Index

 o cancel()
Cancels this scheduled event.
 o runSimulation(double)
Runs a simulation for a specified period of simulated time.
 o stopSimulation()
Stops a simulation.
 o time()
Returns the current simulation time.

Constructors

 o Event
 public Event()

Methods

 o time
 public static final double time()
Returns the current simulation time.

 o runSimulation
 public static final void runSimulation(double period)
Runs a simulation for a specified period of simulated time.

Time will start at 0 and jump from event time to event time until either this period is over, there are no more scheduled events, or the stopSimulation method is called.

All scheduled state events are held in list, and all scheduled time events are held in a list ordered by their associated event times.

At each event time, the wait list is examined to see whether any state event has its condition fulfilled. In that case, the event is removed from the list and its actions are executed.

When no more state events occur, time advances to the next imminent time event, and the associated actions of this time event are executed.

This continues until the simulation ends

Parameters:
period - The length of the simulation period.
 o stopSimulation
 public static final void stopSimulation()
Stops a simulation.

 o cancel
 public final void cancel()
Cancels this scheduled event.

The activity is removed from the the list of which it is a member (the event list or the wait list).

If it is not scheduled, the call has no effect.


All Packages  Class Hierarchy  This Package  Previous  Next  Index