Package SimPy :: Module SimulationRT :: 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)
`` | getbuffered(self)
`` | __init__(self, **pars) x.__init__(...) initializes x; see x.__class__.__doc__ for signature
`` | addSort(self, sortFunc) Adds buffer sorting to this instance of Store.
`` | _put(self, arg) Handles put requests for Store instances
`` | _get(self, arg) Handles get requests
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]

### getnrBuffered(self)

source code

None

### getbuffered(self)

source code

None

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

source code

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

  Overrides: Buffer.__init__

### 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]

### _put(self, arg)

source code

Handles put requests for Store instances

### _get(self, arg)

source code

Handles get requests

Property Details | [hide private]

### nrBuffered

None

  Get Method:
    SimPy.SimulationRT.Store.getnrBuffered(self)
  Set Method:

        None

  Delete Method:

        None

### buffered

None

  Get Method:
    SimPy.SimulationRT.Store.getbuffered(self)
  Set Method:

        None

  Delete Method:

        None