# pypdevsbbl.domain.gpss module — Python(P)DEVS-BBL documentation

# pypdevsbbl.domain.gpss module

This file contains all the GPSS functionality that is used in GPSS2DEVS.

`pypdevsbbl.domain.gpss.``dist`(y, mu, dev=0)

  Standard GPSS distribution to use. Returns a random variable in \(mu \pm dev\).

  Parameters:

  - y (numeric) – A random variable in `[0, 1)()`.
  - mu (int) – The mean.
  - dev (int) – The deviation around the mean.

class `pypdevsbbl.domain.gpss.``Transaction`(id, time=None, priority=0)

  Bases: `object`

  A GPSS Transaction.

  `priority`()

`pypdevsbbl.domain.gpss.``SNA`(name: str, model, transaction: pypdevsbbl.domain.gpss.Transaction = None, time=0.0)

  A lookup function for SNAs.

class `pypdevsbbl.domain.gpss.``Function`(sna, mapping: list, continuous=True)

  Bases: `object`

  Corresponds to GPSS’s `FUNCTION` statement.

  static `parse`(mapping: str, size: int)

    Parses the GPSS code.

    Parameters:

    - mapping (str) – A mapping in the form of `x1,y1/x2,y2/x3,y3...`
    - size (int) – The size of the array.

    Returns: | The mapping list that is required for the `__init__()`.

class `pypdevsbbl.domain.gpss.``_PT`(name)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  Base class for simple pass through.

  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``_AT`(name)

  Bases: `pypdevsbbl.domain.gpss._PT`

  Base class for all GPSS building blocks that just alter the transaction.

  `alter`()

    Changes the transaction.

  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``TERMINATE`(name, count='0')

  Bases: `pypdevsbbl.domain.gpss._PT`

  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``ASSIGN`(name, parameters, assign)

  Bases: `pypdevsbbl.domain.gpss._AT`

  `alter`()

class `pypdevsbbl.domain.gpss.``MARK`(name, field='M1')

  Bases: `pypdevsbbl.domain.gpss._AT`

  `alter`()

class `pypdevsbbl.domain.gpss.``SEIZE`(name)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)
  `can_access`(name, trns, preempted)

class `pypdevsbbl.domain.gpss.``RELEASE`(name)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()

class `pypdevsbbl.domain.gpss.``PREEMPT`(name, interrupt=False)

  Bases: `pypdevsbbl.domain.gpss.SEIZE`

  `can_access`(name, trns, preempted)

class `pypdevsbbl.domain.gpss.``RETURN`(name)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``ENTER`(name, size=1)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``LEAVE`(name, size=1)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()

class `pypdevsbbl.domain.gpss.``QUEUE`(name, size=1)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``DEPART`(name, size=1)

  Bases: `pypdevsbbl.domain.gpss.QUEUE`

  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``TABULATE`(name, size=1)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()

class `pypdevsbbl.domain.gpss.``LINK`(name, B, C=None)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``UNLINK`(name, count, D, E, F=None)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``LOGIC`(name, operator, switch)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()

class `pypdevsbbl.domain.gpss.``TEST`(name, A, operator, B)

  Bases: `pypdevsbbl.domain.gpss._PT`

  `test`()
  `outputFnc`()

class `pypdevsbbl.domain.gpss.``GATE`(name, switch, B=None, status='S')

  Bases: `pypdevsbbl.domain.gpss._PT`

  `outputFnc`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``ADVANCE`(name, seed=None, dist=<function ADVANCE.<lambda>>, args=())

  Bases: `pypdevs.DEVS.CoupledDEVS`

class `pypdevsbbl.domain.gpss.``TRANSFER_ALL`(name, n=2)

  Bases: `pypdevs.DEVS.CoupledDEVS`

class `pypdevsbbl.domain.gpss.``_AU`(name)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  Helper class for all components that sends their updates.

  `timeAdvance`()
  `intTransition`()

class `pypdevsbbl.domain.gpss.``Facility`(name)

  Bases: `pypdevsbbl.domain.gpss._AU`

  `clear`()
  `outputFnc`()
  `extTransition`(inputs)
  `summary`(time=None)

class `pypdevsbbl.domain.gpss.``Storage`(name, capacity)

  Bases: `pypdevsbbl.domain.gpss._AU`

  `clear`()
  `outputFnc`()
  `extTransition`(inputs)
  `summary`(time=None)

class `pypdevsbbl.domain.gpss.``Chain`(name)

  Bases: `pypdevsbbl.domain.gpss._AU`

  `clear`()
  `outputFnc`()
  `timeAdvance`()
  `intTransition`()
  `extTransition`(inputs)
  `summary`(time=None)

class `pypdevsbbl.domain.gpss.``Queue`(name)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `clear`()
  `extTransition`(inputs)
  `summary`(time=None)

class `pypdevsbbl.domain.gpss.``Table`(name, statistic, L, W, N, weighted=False, rate=None)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `count`()
  `sum`()
  `sumOfSquares`()
  `mean`()
  `variance`()
  `std`()
  `clear`()
  `timeAdvance`()
  `intTransition`()
  `extTransition`(inputs)
  `update`(size, value)
  `summary`()

class `pypdevsbbl.domain.gpss.``LogicSwitches`(name)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)
  `summary`()

class `pypdevsbbl.domain.gpss.``Hold`(name, send=False)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``Controller`(name)

  Bases: `pypdevs.DEVS.AtomicDEVS`

  `finished`(count)
  `reset`()
  `timeAdvance`()
  `outputFnc`()
  `intTransition`()
  `extTransition`(inputs)

class `pypdevsbbl.domain.gpss.``GPSS2DEVS`(name, gens=1)

  Bases: `pypdevs.DEVS.CoupledDEVS`

  `controller`()
  `switches`()
  `facility`(name)
  `storage`(name)
  `table`(name)
  `chain`(name)
  `queue`(name)
  `createFacility`(label)
  `createStorage`(label, capacity)
  `createQueue`(label)
  `createTable`(label, statistic, L, W, N, weighted=False, rate=None)
  `createChain`(label)
  `connect`(A, B, delay=False)
  `GENERATE`(label, dist, args=(), max=inf, priority=0)
  `ADVANCE`(label, prev, dist, args=())
  `TERMINATE`(label, count='0')
  `MARK`(label, sna='M1')
  `ASSIGN`(label, parameters, assign)
  `TABULATE`(label, table, size=1)
  `QUEUE`(label, queue, size=1)
  `DEPART`(label, queue, size=1)
  `SEIZE`(label, facility)
  `RELEASE`(label, facility)
  `ENTER`(label, storage, size=1)
  `LEAVE`(label, storage, size=1)
  `PREEMPT`(label, facility, interrupt=False)
  `RETURN`(label, facility)
  `LINK`(label, chain, prev, B, C=None)
  `UNLINK`(label, chain, count, D=None, E=None, F=None)
  `GATE`(label, switch, B=None, status='S')
  `TRANSFER_BOTH`(label, nxt, resource, endp)
  `LOGIC`(label, operator, switch)
  `TEST`(label, A, operator, B)