Package topo :: Package base :: Module simulation :: Class Event
[hide private]
[frames] | no frames]

Class Event

source code

object --+
         |
        Event
Known Subclasses:

Hierarchy of classes for storing simulation events of various types.
Instance Methods [hide private]
 
__init__(self, time)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__call__(self, sim)
Cause some computation to be performed, deliver a message, etc., as appropriate for each subtype of Event.
source code
 
__cmp__(self, ev)
Implements event comparison by time, allowing sorting, and queue maintenance using bisect module or minheap implementations, if needed.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, time)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

__call__(self, sim)
(Call operator)

source code 
Cause some computation to be performed, deliver a message, etc., as appropriate for each subtype of Event. Should be passed the simulation object, to allow access to .time() etc.

__cmp__(self, ev)
(Comparison operator)

source code 

Implements event comparison by time, allowing sorting, and queue maintenance using bisect module or minheap implementations, if needed.

NOTE: identity comparisons should always be done using the 'is' operator, not '=='.