Petrex.Arc (petrex v1.0.0)

Copy Markdown View Source

A weighted arc between a place and a transition.

  • :normal arcs run place → transition (input: the transition consumes weight tokens) or transition → place (output: it produces weight tokens).
  • :inhibitor arcs run place → transition only. The transition is enabled only while the place holds fewer than weight tokens. An inhibitor arc consumes nothing. Weight 1 means "the place is empty".

Weights are positive integers.

Summary

Types

kind()

@type kind() :: :normal | :inhibitor

node_id()

@type node_id() :: Petrex.Place.id() | Petrex.Transition.id()

t()

@type t() :: %Petrex.Arc{
  extra: Petrex.Place.extra(),
  from: node_id(),
  kind: kind(),
  to: node_id(),
  weight: pos_integer()
}