Package SimPy :: Module Simulation :: Class Simulation |
[hide private]
[frames] | no frames]

# Class Simulation

source code

    object --+
             |
            Simulation

Known Subclasses:
  - SimulationRT.SimulationRT
  - , SimulationStep.SimulationStep
  - , 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
_post(self, what, at, prior=False) Post an event notice for process what for time at | source code
_unpost(self, whom) Mark event notice for whom as cancelled if whom is a suspended process | 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
_waitUntilFunc(self, proc, cond) Puts a process 'proc' waiting for a condition into a waiting queue. | source code
_terminate(self, process) Marks a process as terminated. | source code
has_events(self) Checks if there are events which can be processed. | source code
peek(self) Returns the time of the next event or infinity, if no more events are scheduled. | source code
step(self) Executes the next uncancelled event in the eventqueue. | source code
simulate(self, until=0) Start the simulation and run its loop until the timeout ``until`` is reached, stopSimulation is called, or no more events are scheduled. | source code
Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Variables | [hide private]
| _dispatch = `{hold: holdfunc, request: requestfunc, release: re`...``
| _commandcodes = ``[`1`,` 2`,` 3`,` 4`,` 5`,` 6`,` 7`,` 8`,` 9`]``
| _commandwords = ``{`1`:` `'``hold``'``,` 2`:` `'``passivate``'``,` 3`:` `'``request``'``,` 4`:` `'``...``

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, . . . . . . .

### _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.

### has_events(self) | source code
Checks if there are events which can be processed. Returns ``True`` if there are events and the simulation has not been stopped.

Class Variable Details | [hide private]

  ### _dispatch Value:
      {hold: holdfunc, request: requestfunc, release: releasefunc, passivate
      : passivatefunc, waitevent: waitevfunc, queueevent: queueevfunc, waitu
      ntil: waituntilfunc, get: getfunc, put: putfunc,}

  ### _commandwords Value:
      {1: 'hold',
       2: 'passivate',
       3: 'request',
       4: 'release',
       5: 'waitevent',
       6: 'queueevent',
       7: 'waituntil',
       8: 'get',
      ...