Package SimPy :: Module Globals

[hide private]
[frames] | no frames]

# Source Code for Module SimPy.Globals

     1  """
     2  This file provides a global Simulation object and the global simulation methods
     3  used by SimPy up to version 1.9.1.
     4  """
     5  # $Revision: 272 $ $Date: 2009-03-25 13:38:34 +0100 (Mi, 25 Mrz 2009) $
     6  # SimPy version: 2.0
     7
     8  global sim
     9  sim = None
    10
    11 -def initialize():
    12      sim.initialize()
    13
    14 -def now():
    15      return sim.now()
    16
    17 -def stopSimulation():
    18      """Application function to stop simulation run"""
    19      sim.stopSimulation()
    20
    21 -def allEventNotices(self):
    22      """Returns string with eventlist as;
    23              t1: processname, processname2
    24              t2: processname4, processname5, . . .
    25                  . . .  .
    26          """
    27      return sim.allEventNotices()
    28
    29 -def allEventTimes(self):
    30      """Returns list of all times for which events are scheduled.
    31      """
    32      return sim.allEventTimes()
    33
    34 -def startCollection(self, when = 0.0, monitors = None, tallies = None):
    35      """Starts data collection of all designated Monitor and Tally objects
    36      (default = all) at time 'when'.
    37      """
    38      sim.startCollection( when = when, monitors = monitors, tallies = tallies)
    39
    40 -def _startWUStepping():
    41      """Application function to start stepping through simulation for waituntil
    42      construct."""
    43      sim._startWUStepping()
    44
    45 -def _stopWUStepping():
    46      """Application function to stop stepping through simulation."""
    47      sim._stopWUStepping()
    48
    49 -def activate(obj, process, at = 'undefined', delay = 'undefined',
    50                prior = False):
    51      """Application function to activate passive process."""
    52      sim.activate(obj, process, at = at, delay = delay, prior = prior)
    53
    54 -def reactivate(obj, at = 'undefined', delay = 'undefined', prior = False):
    55      """Application function to reactivate a process which is active,
    56      suspended or passive."""
    57      sim.reactivate(obj, at = at, delay = delay, prior = prior)
    58
    59 -def simulate(until = 0):
    60      return sim.simulate(until = until)
    61