All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class simulation.event.Event

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

public abstract class Event
extends java.lang.Object
This class may be used for event-based discrete event simulation.

Events are created as instances of Event-derived classes that override the abstract method actions.

The actions method is used to specify the actions of of a class of events.

See Also:
simulation.event.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 schedule(double)
Schedules this event to occur at the specified event time.
 o stopSimulation()
Stops a simulation.
 o time()
Returns the current simulation time.

Constructors

 o Event
 public Event()

Methods

 o schedule
 public final void schedule(double evTime)
Schedules this event to occur at the specified event time.

The event is inserted into the event list at a position corresponding to the current simulation time, and after any processes with the same event time.

Parameters:
evTime - The event time.
Throws: RuntimeException
if evTime < time()
 o cancel
 public final void cancel()
Cancels this scheduled event.

The event is removed from the event list. If it is not scheduled, the call has no effect.

 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.

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


All Packages  Class Hierarchy  This Package  Previous  Next  Index