Package SimPy :: Module Lib :: Class Store

[hide private]
[frames] | no frames]

# Class Store

source code

       object --+
                |
    Lister.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.

Instance Methods | [hide private]

getnrBuffered(self) | source code

getbuffered(self) | source code

__init__(self, **pars) x.__init__(...) initializes x; see x.__class__.__doc__ for signature | source code

addSort(self, sortFunc) Adds buffer sorting to this instance of Store. | source code

_put(self, arg) Handles put requests for Store instances | source code

_get(self, arg) Handles get requests | source code

Inherited from `Lister.Lister`: `__repr__`, `__str__`, `attrnames` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

Class Variables | [hide private]

Inherited from `Buffer`: `priorityDefault` Inherited from `Lister.Lister`: `indent`

Properties | [hide private]

| nrBuffered
| buffered
Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, **pars)
(Constructor)

source code

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
  (inherited documentation)

### addSort(self, sortFunc)

source code

    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]

Property Details | [hide private]

### nrBuffered

Get Method:
  getnrBuffered(self)

### buffered

Get Method:
  getbuffered(self)