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

Type Store

object --+        
         |        
    Lister --+    
             |    
        Buffer --+
                 |
                Store


Models buffers for processes coupled by putting/getting distinguishable items. Blocks a process when a put would cause buffer overflow or a get would cause buffer underflow. Default queuing discipline for blocked processes is priority FIFO.
Method Summary
  __init__(self, **pars)
  addSort(self, sortFunc)
Adds buffer sorting to this instance of Store.
  getnrBuffered(self)
  gettheBuffer(self)
  _get(self, arg)
Handles get requests
  _put(self, arg)
Handles put requests for Store instances
    Inherited from Lister
  __repr__(self)
  __str__(self)
  attrnames(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Property Summary
  nrBuffered
  theBuffer

Class Variable Summary
    Inherited from Buffer
int priorityDefault = 0                                                                     
    Inherited from Lister
int indent = 0                                                                     

Method Details

addSort(self, sortFunc)

Adds buffer sorting to this instance of Store. It maintains
theBuffer sorted by the sortAttr attribute of the objects in the
buffer.
The user-provided 'sortFunc' must look like this:

def mySort(self,par):
    tmplist=[(x.sortAttr,x) for x in par]
    tmplist.sort()
    return [x for (key,x) in tmplist]

_get(self, arg)

Handles get requests

_put(self, arg)

Handles put requests for Store instances

Property Details

nrBuffered

Get Method:
getnrBuffered(self)

theBuffer

Get Method:
gettheBuffer(self)

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