.. _cpp-causality/RealisabilityQuery: ********************************************************** causality/RealisabilityQuery.hpp ********************************************************** .. default-domain:: cpp .. default-role:: cpp:texpr .. py:currentmodule:: mod .. cpp:namespace:: mod Class ``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]_. Synopsis ^^^^^^^^ .. alias:: causality::RealisabilityQuery :maxdepth: 2 :noroot: Details ^^^^^^^ .. cpp:namespace-push:: causality::RealisabilityQuery .. function:: explicit RealisabilityQuery(std::shared_ptr dg_) Construct a query with multiplicity 1 and no borrowing. :throws: :class:`LogicError` if `dg_` is null. .. function:: std::shared_ptr getDG() const :returns: the underlying derivation graph. .. function:: void setMultiplicity(int multiplicity) int getMultiplicity() const Set/get the multiplicity of the query. It must be at least 1. :throws: (set) :class:`LogicError` if `multiplicity < 1`. .. function:: void setBorrow(dg::DG::Vertex v, int count) int getBorrow(dg::DG::Vertex v) const Set/get the amount of flow allowed to be borrowed at the vertex represented by the graph. :throws: :class:`LogicError` if `!v`. :throws: :class:`LogicError` if `v.getDG() != getDG()`. :throws: (set) :class:`LogicError` if `count < 0`. .. function:: void setBorrow(std::shared_ptr g, int count) int getBorrow(std::shared_ptr g) const Calls the corresponding functions with the result of `getDG()->findVertex(g)`. .. function:: void setRespectTransit(bool v) bool getRespectTransit() const Set/get whether transit edges must conform to how they are used in the flow. Setting this to `false` may give sequences violating flow constraints. .. function:: std::optional findDAG(const hyperflow::Solution &s) const :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. :throws: :class:`LogicError` if any graph ``g`` given to :func:`setBorrow` with non-zero count is not a vertex in the underlying derivation graph of the given flow solution, i.e., if ``s.getFlow()->getDG()->findVertex(g)`` returns a null vertex. .. cpp:namespace-pop::