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: 136 $ $Date: 2008-11-01 11:18:13 +0100 (Sa, 01 Nov 2008) $ 
 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 _startWUStepping():
22 """Application function to start stepping through simulation for waituntil construct.""" 23 sim._startWUStepping()
24
25 -def _stopWUStepping():
26 """Application function to stop stepping through simulation.""" 27 sim._stopWUStepping()
28
29 -def activate(obj, process, at = 'undefined', delay = 'undefined', prior = False):
30 """Application function to activate passive process.""" 31 sim.activate(obj, process, at, delay, prior)
32
33 -def reactivate(obj, at = 'undefined', delay = 'undefined', prior = False):
34 """Application function to reactivate a process which is active, 35 suspended or passive.""" 36 sim.reactivate(obj, at, delay, prior)
37
38 -def simulate(until = 0):
39 return sim.simulate(until = until)
40