4.1.8.5. causality/RealisabilityQuery¶
- class causality.RealisabilityQuery¶
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.
See also [ABFFMS-Realisability].
- __init__(dg)¶
Construct a query with multiplicity 1 and no borrowing.
- Raises:
LogicError
ifdg
isNone
.
- multiplicity¶
Access the multiplicity of the query. It must be at least 1.
- Type:
- 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[self.dg.findVertex(g)]
.
- __getitem__(v)¶
- __getitem__(g)
- Parameters:
- Return type:
- Returns:
the amount of flow allowed to be borrowed at a given vertex. The version taking a graph as argument is equivalent to
self[self.dg.findVertex(g)]
.
- respectTransit¶
Access whether transit edges must conform to how they are used in the flow. Setting this to
False
may give results violating flow constraints.
- findDAG(s)¶
- Parameters:
s (hyperflow.Solution) – the flow solution to query for a causality DAG.
- Returns:
a causality DAG that can be folded back into the given flow solution, using the query settings in this object, if one can be found.
- Return type:
Optional[DAG]
- Raises:
LogicError
if any graphg
given asself[g]
with non-zero count is not a vertex in the underlying derivation graph of the given flow solution, i.e., ifself.dg.findVertex(g)
returns a null vertex.