Package SimPy :: Module SimulationRT
[show private | hide private]
[frames | no frames]

Module SimPy.SimulationRT

Classes
Buffer Abstract class for buffers Blocks a process when a put would cause buffer overflow or a get would cause buffer underflow.
FIFO  
Histogram A histogram gathering and sampling class
Level Models buffers for processes putting/getting un-distinguishable items.
Monitor Monitored variables
PriorityQ Queue is always ordered according to priority.
Process Superclass of classes which may use generator functions
Queue  
Resource Models shared, limited capacity resources with queuing; FIFO is default queuing discipline.
SimEvent Supports one-shot signalling between processes.
Store Models buffers for processes coupled by putting/getting distinguishable items.
Tally  
__Evlist Defines event list and operations on it
_Action Structure (who=process owner, generator=process)

Exceptions
FatalSimerror  
Simerror  

Function Summary
  activate(object, process, at, delay, prior)
Application function to activate passive process.
  allEventNotices()
Returns string with eventlist as t1: [procname,procname2] t2: [procname4,procname5, .
  allEventTimes()
Returns list of all times for which events are scheduled.
  getfunc(a)
Handles 'yield get'
  holdfunc(a)
  initialize()
  now()
  passivatefunc(a)
  putfunc(a)
Handles 'yield put'
  queueevfunc(a)
  reactivate(obj, at, delay, prior)
Application function to reactivate a process which is active, suspended or passive.
  releasefunc(a)
  requestfunc(a)
Handles 'yield request,self,res' and 'yield (request,self,res),(<code>,self,par)'.
  rtnow()
  scheduler(till)
Schedules Processes/semi-coroutines until time 'till'.
  simulate(until, real_time, rel_speed)
Schedules Processes/semi-coroutines until time 'until'
  stopSimulation()
Application function to stop simulation run
  test_demo()
  test_interrupt()
  testSimEvents()
  testwaituntil()
Demo of waitUntil capability.
  waitevfunc(a)
  waituntilfunc(par)
  _startWUStepping()
Application function to start stepping through simulation for waituntil construct.
  _stopWUStepping()
Application function to stop stepping through simulation.
  _test()
Gets called by simulate after every event, as long as there are processes waiting in condQ for a condition to be satisfied.
  _waitUntilFunc(proc, cond)

Variable Summary
str __version__ = '1.7.1 Jun 2006'
list condQ = []
int False = 0                                                                     
int get = 8                                                                     
int hold = 1                                                                     
int passivate = 2                                                                     
int put = 9                                                                     
int queueevent = 6                                                                     
int release = 4                                                                     
int request = 3                                                                     
float rtstart = 1.1824069185374297e-005                                               
int True = 1                                                                     
int waitevent = 5                                                                     
int waituntil = 7                                                                     
bool __TESTING = False
NoneType _e = None                                                                  
int _endtime = 0                                                                     
bool _stop = True
int _t = 0                                                                     

Function Details

activate(object, process, at='undefined', delay='undefined', prior=0)

Application function to activate passive process.

allEventNotices()

Returns string with eventlist as t1: [procname,procname2] t2: [procname4,procname5, . . . ] . . . .

allEventTimes()

Returns list of all times for which events are scheduled.

getfunc(a)

Handles 'yield get'

putfunc(a)

Handles 'yield put'

reactivate(obj, at='undefined', delay='undefined', prior=0)

Application function to reactivate a process which is active, suspended or passive.

requestfunc(a)

Handles 'yield request,self,res' and 'yield (request,self,res),(<code>,self,par)'. <code> can be 'hold' or 'waitevent'.

scheduler(till=0)

Schedules Processes/semi-coroutines until time 'till'. Deprecated since version 0.5.

simulate(until=0, real_time=0, rel_speed=1)

Schedules Processes/semi-coroutines until time 'until'

stopSimulation()

Application function to stop simulation run

testwaituntil()

Demo of waitUntil capability.

Scenario: Three workers require sets of tools to do their jobs. Tools are shared, scarce resources for which they compete.

_startWUStepping()

Application function to start stepping through simulation for waituntil construct.

_stopWUStepping()

Application function to stop stepping through simulation.

_test()

Gets called by simulate after every event, as long as there are processes waiting in 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.

Variable Details

__version__

Type:
str
Value:
'1.7.1 Jun 2006'                                                       

condQ

Type:
list
Value:
[]                                                                     

False

Type:
int
Value:
0                                                                     

get

Type:
int
Value:
8                                                                     

hold

Type:
int
Value:
1                                                                     

passivate

Type:
int
Value:
2                                                                     

put

Type:
int
Value:
9                                                                     

queueevent

Type:
int
Value:
6                                                                     

release

Type:
int
Value:
4                                                                     

request

Type:
int
Value:
3                                                                     

rtstart

Type:
float
Value:
1.1824069185374297e-005                                               

True

Type:
int
Value:
1                                                                     

waitevent

Type:
int
Value:
5                                                                     

waituntil

Type:
int
Value:
7                                                                     

__TESTING

Type:
bool
Value:
False                                                                  

_e

Type:
NoneType
Value:
None                                                                  

_endtime

Type:
int
Value:
0                                                                     

_stop

Type:
bool
Value:
True                                                                   

_t

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Wed Jun 14 14:32:46 2006 http://epydoc.sf.net