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

Module SimPy.Simulation

Classes
Buffer Abstract class for buffers Blocks a process when a put would cause buffer overflow or a get would cause buffer underflow.
FIFO  
FireEvent Fires reneging event
Histogram A histogram gathering and sampling class
JobEvt Job class for testing event reneging
JobEvtMulti Job class for testing event reneging with multi-event lists
JobTO Job class for testing timeout reneging
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  

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)'.
  scheduler(till)
Schedules Processes/semi-coroutines until time 'till'.
  simulate(until)
Schedules Processes/semi-coroutines until time 'until'
  stopSimulation()
Application function to stop simulation run
  test_demo()
  test_interrupt()
  testNoEvent()
Test that processes acquire resource normally if no event fires
  testNoTimeout()
Test that resource gets acquired without timeout
  testSimEvents()
  testTimeout1()
Test that timeout occurs when resource busy
  testTimeout2()
Test that timeout occurs when resource has no capacity free
  testWaitEvent1()
Test that signalled event leads to renege when resource busy
  testWaitEvent2()
Test that renege-triggering event can be one of an event list
  testwaituntil()
Demo of waitUntil capability.
  waitevfunc(a)
  waituntilfunc(par)

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                                                                     
int True = 1                                                                     
int waitevent = 5                                                                     
int waituntil = 7                                                                     

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)

Schedules Processes/semi-coroutines until time 'until'

stopSimulation()

Application function to stop simulation run

testNoEvent()

Test that processes acquire resource normally if no event fires

testNoTimeout()

Test that resource gets acquired without timeout

testTimeout1()

Test that timeout occurs when resource busy

testTimeout2()

Test that timeout occurs when resource has no capacity free

testWaitEvent1()

Test that signalled event leads to renege when resource busy

testWaitEvent2()

Test that renege-triggering event can be one of an event list

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.

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                                                                     

True

Type:
int
Value:
1                                                                     

waitevent

Type:
int
Value:
5                                                                     

waituntil

Type:
int
Value:
7                                                                     

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