jsim.event
Class Scheduler

java.lang.Object
  extended by jsim.event.Scheduler

public class Scheduler
extends java.lang.Object

This class schedules events and implements the time advance mechanism. No constructor is needed for the class since all data members are static.

Version:
1.0, 27 Feb 1997
Author:
Zhiwei Zhang

Constructor Summary
Scheduler()
           
 
Method Summary
static double currentTime()
          Return the current time in the simulation.
static void schedule(Event event, double timeDelay)
          This schedule method places an event on the Future Event List (FEL) for later execution.
static void schedule(Event event, double timeDelay, int priority)
          This schedule method places an event on the Future Event List (FEL) for later execution.
static void startSim()
          Start the simulation by processing the first event and subsequent events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scheduler

public Scheduler()
Method Detail

schedule

public static void schedule(Event event,
                            double timeDelay)
This schedule method places an event on the Future Event List (FEL) for later execution. Event are ordered first by their event time, and next by priority. In this case all events have the same priority (MID_PRIORITY).

Parameters:
event - event to schedule
timeDelay - how far in the future to schedule the event

schedule

public static void schedule(Event event,
                            double timeDelay,
                            int priority)
This schedule method places an event on the Future Event List (FEL) for later execution. Event are ordered first by their event time, and next by priority.

Parameters:
event - event to schedule
timeDelay - how far in the future to schedule the event
priority - priority of the event (low = 0, high = 10)

startSim

public static void startSim()
Start the simulation by processing the first event and subsequent events.


currentTime

public static double currentTime()
Return the current time in the simulation.

Returns:
double the current time