4.1.8.4. causality/Flow

class mod.CausalityFlowQuery

Representation of a query for a DAG that can be folded back into a given flow. The query is based on a derivation graph and can thus be used for any flow solution from a model based on that derivation graph.

__init__(dg)

Construct a query with multiplicity 1 and no borrowing.

Raises

LogicError if dg is None.

dg

(Read-only) The underlying derivation graph.

Type

DG

multiplicity

Access the multiplicity of the query. It must be at least 1.

Type

int

Raises

(set) LogicError if assigned a number less than 1.

__setitem__(v, count)
__setitem__(g, count)

Set the amount of flow allowed to be borrowed at a given vertex. The version taking a graph as argument is equivalent to self[dg.findVertex(g)].

Parameters
  • v (DGVertex) – a vertex in the derivation graph the query is intended for.

  • g (Graph) – a graph representing a vertex in the derivation graph the query is intended for.

  • count (int) – the amount of tokens to allowed to be borrowed in a solution.

__getitem__(v)
__getitem__(g)
Parameters
  • v (DGVertex) – a vertex in the derivation graph the query is intended for.

  • g (Graph) – a graph representing a vertex in the derivation graph the query is intended for.

Return type

int

Returns

the amount of flow allowed to be borrowed at a given vertex. The version taking a graph as argument is equivalent to self[dg.findVertex(g)].

constrainRouting

Access whether transit edges must conform to the routing expressed by the flow. Setting this to false may give results violating flow constraints.