LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
ag.h File Reference

LINE Agent Language (LAL): the agent-based (AG) decompositions of a finite composition, ported from the native Python solver_ag/lal_rcat.py, lal_certificate.py, lal_meanfield.py and lal_grouped.py. More...

#include <algorithm>
#include <cmath>
#include <limits>
#include <map>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "json.hpp"
#include "line/api/mc/ctmc_solve.h"
#include "line/lang/lal/core.h"
#include "line/lang/lal/ctmc.h"
#include "line/num/number.h"
Include dependency graph for ag.h:

Go to the source code of this file.

Classes

struct  line::lal::GroupDistribution
 One group's joint distribution (diagnostics['group_distributions']). More...
struct  line::lal::AGResult
 The result of an AG decomposition (LALRCATResult, LALMeanFieldResult, LALGroupedResult). More...
struct  line::lal::Lowering
 The lowering of a minimum-rate synchronisation (_lower_minimum). More...
struct  line::lal::Support
 A support answer: (ok, reason). More...
struct  line::lal::Certificate
 A successful RCAT certificate. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::lal

Functions

Lowering line::lal::lower_minimum (const Model &snapshot)
 Lower a provably dominated minimum without changing its event law (_lower_minimum).
Support line::lal::structural_support (const Model &original, const std::string &method="inaprc")
 Decomposition constraints checked without a global state space (structural_support).
Support line::lal::certificate_support (const Model &original)
 The certificate's conservative structural prerequisites (certificate_support).
Support line::lal::full_reachability (const Model &snapshot, std::size_t limit=10000)
 Whether one initial state reaches the whole Cartesian space (full_reachability).
std::pair< std::optional< Certificate >, std::string > line::lal::certify (const Model &snapshot, const std::vector< double > &estimated_rates, double tol)
 Try a bounded exact certificate; failure is not a counterexample (certify).
AGResult line::lal::rcat_solve (const Model &original, double tol=1e-4, long max_iter=100, const std::string &method="inaprc")
 Finite-agent RCAT fixed point (lal_rcat.solve_composition), method inap or inaprc.
std::pair< bool, std::string > line::lal::certify_result (const Model &original, AGResult &result, double tol)
 Replace an approximate solution with an exactly verified RCAT solution (certify_result).
AGResult line::lal::meanfield_solve (const Model &snapshot, double tol=1e-4, long max_iter=100, double damping=.5)
 Finite LAL mean-field approximation (lal_meanfield.solve_composition).
std::vector< std::vector< std::string > > line::lal::group_partition (const Model &snapshot, const std::optional< std::vector< std::vector< std::string > > > &groups, long max_states)
 Validate and complete a user partition without enumeration (group_partition).
AGResult line::lal::grouped_solve (const Model &snapshot, const std::optional< std::vector< std::vector< std::string > > > &groups, long max_states=256, double tol=1e-4, long max_iter=100, double damping=.5, bool source_truncated=false)
 Grouped decomposition (lal_grouped.solve_composition): exact within groups, mean-field across them.
nlohmann::json line::lal::compare_with_ctmc (const Model &snapshot, const AGResult &result, std::optional< std::size_t > max_states=std::nullopt)
 Numerically compare the product of agent marginals with the exact finite CTMC (compare_with_ctmc).

Detailed Description

LINE Agent Language (LAL): the agent-based (AG) decompositions of a finite composition, ported from the native Python solver_ag/lal_rcat.py, lal_certificate.py, lal_meanfield.py and lal_grouped.py.

  • rcat_solve (inap / inaprc): the finite-agent RCAT reversed-rate fixed point. An approximation unless certified.
  • certify / certify_result: a bounded exact-arithmetic RCAT certificate. Every computation is in Rational on the exact binary value of each double (Python Fraction.from_float); candidate rates come from limit_denominator, implemented as Python's Fraction.limit_denominator.
  • meanfield_solve: independent local marginals with the expected-minimum rule for minimum-rate synchronisation.
  • grouped_solve: exact within user groups, mean-field across them.
  • compare_with_ctmc: the numerical comparison against the exact CTMC.

Python's pandas attrs keys beyond the named TableAttrs fields (converged, rcat_residual, product_form_certified, groups, fixed_point_residual) are carried in TableAttrs::extra under the same names; diagnostics holds exactly Python's diagnostics dict.

Definition in file ag.h.