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

Module SimPy.SimulationTrace

SimulationTrace 1.5.1
__version__ = '$Revision: 1.1.1.3.4.2 $ $Date: 2005/01/30 11:41:26 $ kgm'
LICENSE:
Copyright (C) 2002, 2005  Klaus G. Muller, Tony Vignaux
mailto: kgmuller@xs4all.nl and Tony.Vignaux@vuw.ac.nz

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
END OF LICENSE

Implements a trace capability for SimPy 1.3.
Based on generators (Python 2.2 and later)



**Change history:**
    9 May 03: SimulationTrace module based on SimPy 1.3
    
    12/5/2003: Changed eventlist handling from dictionary to bisect
    
    9/6/2003: - Changed eventlist handling from pure dictionary to bisect-
                sorted "timestamps" list of keys, resulting in greatly 
                improved performance for models with large
                numbers of event notices with differing event times.
                =========================================================
                This great change was suggested by Prof. Simon Frost. 
                Thank you, Simon! This version 1.3 is dedicated to you!
                =========================================================
              - Added import of Lister which supports well-structured 
                printing of all attributes of Process and Resource instances.

    November 03: Brought up to Simulation 1.4alpha
    
    13 Dec 2003: Merged in Monitor and Histogram

    27 Feb 2004: Repaired bug in activeQ monitor of class Resource. Now actMon
                 correctly records departures from activeQ.
                 
    19 May 2004: Added erroneously omitted Histogram class.
    
    5 Sep 2004: Added SimEvents synchronization constructs
    
    17 Sep 2004: Added waituntil synchronization construct
                     
    01 Dec 2004: SimPy version 1.5
                 Changes in this module: Repaired SimEvents bug re proc.eventsFired

    12 Jan 2005: SimPy version 1.5.1
                 Changes in this module: Monitor objects now have a default name
                                         'a_Monitor'

Classes
FIFO  
Histogram A histogram gathering and sampling class
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.
Trace  

Exceptions
Simerror  

Function Summary
  activate(object, process, at, delay, prior)
Application function to activate passive process.
  allEventNotices()
Returns string with eventlist as list of tuples (eventtime,action)
  holdfunc(a)
  initialize()
  now()
  passivatefunc(a)
  queueevfunc(a)
  reactivate(object, at, delay, prior)
Application function to reactivate a process which is active, suspended or passive.
  releasefunc(a)
  requestfunc(a)
  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()
  testSimEvents()
  testwaituntil()
Demo of waitUntil capability.
  waitevfunc(a)
  waituntilfunc(par)

Variable Summary
str __version__ = '1.5.1 February 2005'
list condQ = []
int False = 0                                                                     
int hold = 1234                                                                  
int passivate = 5678                                                                  
int queueevent = 8765                                                                  
int release = 246                                                                   
int request = 135                                                                   
int True = 1                                                                     
int waitevent = 4321                                                                  
int waituntil = 999                                                                   

Function Details

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

Application function to activate passive process.

allEventNotices()

Returns string with eventlist as list of tuples (eventtime,action)

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

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

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

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.5.1 February 2005'                                                  

condQ

Type:
list
Value:
[]                                                                     

False

Type:
int
Value:
0                                                                     

hold

Type:
int
Value:
1234                                                                  

passivate

Type:
int
Value:
5678                                                                  

queueevent

Type:
int
Value:
8765                                                                  

release

Type:
int
Value:
246                                                                   

request

Type:
int
Value:
135                                                                   

True

Type:
int
Value:
1                                                                     

waitevent

Type:
int
Value:
4321                                                                  

waituntil

Type:
int
Value:
999                                                                   

Generated by Epydoc 2.1 on Mon Jan 31 12:03:08 2005 http://epydoc.sf.net