Package SimPy :: Module Simulation :: Class Simulation

[hide private]
[frames] | no frames]

# Class Simulation

source code

    object --+
             |
            Simulation

Known Subclasses:
  - SimulationStep.SimulationStep
  - , SimulationRT.SimulationRT
  - , SimulationTrace.SimulationTrace

Instance Methods | [hide private]

__init__(self) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code

initialize(self) | source code

now(self) | source code

stopSimulation(self) Application function to stop simulation run | source code

_startWUStepping(self) Application function to start stepping through simulation for waituntil construct. | source code

_stopWUStepping(self) Application function to stop stepping through simulation. | source code

allEventNotices(self) Returns string with eventlist as; t1: processname, processname2 t2: processname4, processname5, . | source code

allEventTimes(self) Returns list of all times for which events are scheduled. | source code

activate(self, obj, process, at=`'``undefined``'`, delay=`'``undefined``'`, prior=False) Application function to activate passive process. | source code

reactivate(self, obj, at=`'``undefined``'`, delay=`'``undefined``'`, prior=False) Application function to reactivate a process which is active, suspended or passive. | source code

startCollection(self, when=0.0, monitors=None, tallies=None) Starts data collection of all designated Monitor and Tally objects (default = all) at time 'when'. | source code

_test(self) Gets called by simulate after every event, as long as there are processes waiting in self.condQ for a condition to be satisfied. | source code

_waitUntilFunc(self, proc, cond) Puts a process 'proc' waiting for a condition into a waiting queue. | source code

simulate(self, until=0) Schedules Processes / semi - coroutines until time 'until' | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self)
(Constructor)

source code

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
  (inherited documentation)

### allEventNotices(self)

source code

Returns string with eventlist as; t1: processname, processname2 t2: processname4, processname5, . . . . . . .

### _test(self)

source code

Gets called by simulate after every event, as long as there are processes waiting in self.condQ for a condition to be satisfied. Tests the conditions for all waiting processes. Where condition satisfied, reactivates that process immediately and removes it from queue.

### _waitUntilFunc(self, proc, cond)

source code

Puts a process 'proc' waiting for a condition into a waiting queue. 'cond' is a predicate function which returns True if the condition is satisfied.