pypdevsbbl.extra.packaging module

Helper file for pypdevsbbl.generic.transformers.Pack and pypdevsbbl.generic.transformers.Unpack blocks.

The classes in this file represent generic containers in which items can be “packed” together.

class pypdevsbbl.extra.packaging.Package(*args)[source]

Bases: object

Generic container that holds items.

All custom containers must inherit from this class, or implement the same methods.

Variables:contents (list) – A container for all packed items.
pack(new, elapsed=0.0, time=0.0)[source]

Packs a new item in this package.

Parameters:
  • new (any) – The new object to join to the package.
  • elapsed (numeric) – The elpased time since the last package. Defaults to 0.
  • time (numeric) – The total simulation time. Defaults to 0.
unpack()[source]

Releases the contents of this package.

After this method is executed, the Package must be in its original state.

finished()[source]

Indicates if the package is finished or not.

Whenever this evaluates to True after a pack()-call, the package should be released automatically.

class pypdevsbbl.extra.packaging.SizedPackage(size)[source]

Bases: pypdevsbbl.extra.packaging.Package

A Package that has a maximal size.

finished()[source]