pypdevsbbl.domain.industry module

Domain-specific building block for industrial purposes.

class pypdevsbbl.domain.industry.ConveyorBelt(name, v, L, K=inf)[source]

Bases: pypdevs.DEVS.CoupledDEVS

A conveyor belt with items moving over it.

Basically, a conveyor can be seen as a glorified queue that uses speed for timing purposes. Internally, there is a pypdevsbbl.generic.queues.SimpleQueue and a pypdevsbbl.generic.transformers.Transformer that have been called <name>-queue and <name>-transformer respectively, where <name> indicates the current block’s name.

_images/conveyor-belt.svg
Parameters:
  • name (str) – The name of the block.
  • v (numeric) – The conveyor speed.
  • L (numeric) – The length of the conveyor.
  • K (numeric) – The capacity of the conveyor. Defaults to INFINITY.
Input Ports:
  • enter (any) – The items that enter the conveyor belt.
  • velocity (numeric) – A new velocity at which the conveyor must run.
Output Ports:
  • leave (any) – The items that leave the conveyor belt.
  • overflow (any) – The items that leave the conveyor because of overflow.
class pypdevsbbl.domain.industry.Transporter(name, path, vmax, a=1, d=1, dist=<function distance.euclidean>, chained=False, start=None, passthrough=False, eps=1e-06)[source]

Bases: pypdevs.DEVS.AtomicDEVS

Transports an item linearly over a path.

When not chained, the item is picked up at the start of the path before being transported to the end of the path, where it is dropped off. Next, we return over a straight line to the beginning and start over again.

When chained, instead of returning to the beginning, we move to the next position where items can be picked up and start over again.

_images/transporter.svg
Parameters:
  • name (str) – The name of the block.
  • path (iter) – An ordered set of pypdevsbbl.extra.spatial.Coordinate objects, indicative of each point in the path. It is assumed there is a full stop between all points in the path. There must be at least one point.
  • vmax (numeric) – The maximal velocity of the transporter.
  • a (numeric) – Strictly positive value that indicates the acceletarion of the transporter. Must not be INFINITY. Defaults to 1.
  • d (numeric) – Strictly positive value that indicates the deceleration of the transporter. Must not be INFINITY. Defaults to 1.
  • dist (def) – Distance function to use. As arguments, it takes two pypdevsbbl.extra.spatial.Coordinate objects and it returns a numeric value, indicative of the distance. See also pypdevsbbl.extra.spatial.distance. Defaults to pypdevsbbl.extra.spatial.distance.euclidean().
  • chained (bool) – Indicator that the block is chained. Defaults to False.
  • start (Coordinate) – The starting point of the transporter. It can be used to indicate a depository where the transporter starts. When None, the beginning of the path is assumed. If chained is True, this must be set to indicate the first block and/or its offset. All other blocks in the chain must have this value set to None. Defaults to None.
  • passthrough (bool) – Can be used to indicate that this transporter will only follow a path and not pick up any items. In a chain, this allows for more complex motion to the next pickup point. Only useful within that context and is therefore only set if chained is True.
  • eps (numeric) – The maximal distance from a point the transformer may be to be assumed at that location. Defaults to 1e-6.
State:
  • item (any) – The item that’s being carried.
  • input (any) – The new item that arrives.
  • elapsed (numeric) – The elapsed time since last event.
  • duration (numeric) – The duration until a next event is scheduled.
Input Ports:
  • input (any) – A new item that wants to be transported.
  • previous (Coordinate) – The end location in a chained transformer.
Output Ports:
  • restock (bool) – A simple message that indicates the block can accept a new item for transportation.
  • blocked (any) – The items that don’t have permission to enter.
  • output (any) – The items that are dropped off.
  • next (Coordinate) – The end location in a chained transformer.
duration()[source]

Actual computation of the duration of the full path.

timeAdvance()[source]
outputFnc()[source]
intTransition()[source]
extTransition(inputs)[source]