Table of Contents

Class: Scheduler es/sim.py

This class is the interface between the Event classes and the EventList. It has two objectives:

  • It constrains an Event subclass to access only some operations of the EventList. For example, events when executed are allowed to schedule new events, but they should not be able to do deletemin(). The only way an event will be able to removed a scheduled event will be through the cancel() method.

  • It has a notion of time, it will disallow scheduling an event in the past.

Methods   
__init__
cancel
schedule
  __init__ 
__init__ (
        self,
        eventlist,
        currtime,
        )

Constructs a new scheduler with eventlist as the underlying event list. currtime is a StateVar containing the current time.

  cancel 
cancel ( self,  event )

Removes an event that has been previously scheduled. A EventNotFoundError is raised if the event is not in the list.

  schedule 
schedule ( self,  event )

Schedules an event at an absolute time. Raises an InvalidTimeError if the event is scheduled in the past (event time smaller than current time). Scheduling at the current time is allowed.

Exceptions   
InvalidTimeError(event.getTime() )

Table of Contents

This document was automatically generated on Thu Dec 20 18:40:47 2001 by HappyDoc version r1_6_1