![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
SolverAG on a finite LAL composition. More...
#include <line/lang/lal/solver_ag.h>
Public Types | |
| typedef std::function< Result(const Model &, std::optional< std::size_t >)> | CTMCBackend |
| The explicit-CTMC backend of default/ctmc (Python's module-level lal_ctmc.solve_composition); replaceable so a test can force a refusal. | |
Public Member Functions | |
| SolverAG (const Composition &model, AGOptions options=AGOptions()) | |
| SolverAG (const Composition &&, AGOptions=AGOptions())=delete | |
| Compiled | getStruct () const |
| getStruct: on a Composition the reference returns model.getStruct(), the finite CTMC states, generator and labelled event matrices (Composition::get_struct, which validates the composition first). | |
| Compiled | get_struct () const |
| std::string | resolveMethod () const |
| The identity: default is gated as itself (resolveMethod). | |
| Support | supportsModelMethod (const std::string &method) const |
| Structural gate for the requested method (supportsModelMethod). | |
| SolverAG & | runAnalyzer () |
| Run the selected method and store the result (runAnalyzer). | |
| StateTable | getAvgTable () |
| State probabilities (getAvgTable). | |
| ActionTable | getActTable () |
| Steady-state labelled event rates (getActTable). | |
| ActionTable | getActT () |
| ActionTable | actT () |
| ActionTable | getActionTable () |
| std::vector< Matrix< double > > | getAvgTard () |
| getAvgTard(), inherited by the reference from NetworkSolver: mean class tardiness against the JobClass deadlines, as {Tard, SysTard}. | |
| std::vector< Matrix< double > > | get_avg_tard () |
| double | getAvgAct (const ActionSpec &action) |
| Throughput of one LAL action (named as in SolverCTMC::getAvgAct). | |
| double | getAvgAct (const std::string &node, lang::EventType event, const std::optional< std::string > &jobclass=std::nullopt, const std::optional< std::string > &mode=std::nullopt) |
| double | getAvgAct (std::size_t node, lang::EventType event, std::size_t jobclass=0) |
| std::vector< double > | getActAvg (const std::vector< ActionSpec > &actions) |
| Throughputs of several actions, each named as in getAvgAct. | |
| void | getAvg () const |
| Queueing-network averages are refused on a general composition (getAvg). | |
| const AGResult & | getAGResult () |
| The result container, solving first if needed (getAGResult). | |
| nlohmann::json | getAGDiagnostics (bool compare_ctmc=false, std::optional< std::size_t > max_states=std::nullopt) |
| Diagnostics, optionally with a CTMC comparison (getAGDiagnostics). | |
| void | setCTMCBackend (CTMCBackend backend) |
| Replace the explicit-CTMC backend (Python tests monkeypatch it). | |
| const std::vector< std::string > & | warnings () const |
| Warnings raised by the last solves, in order (also written to std::cerr). | |
Static Public Member Functions | |
| static AGOptions | defaultOptions () |
| static std::vector< std::string > | listLALMethods () |
| Methods available for a finite LAL Composition (listLALMethods). | |
| static std::vector< std::string > | listValidMethods () |
| listValidMethods: on a Composition the reference answers listLALMethods (SolverAG.m), so this solver, which only takes one, answers the same list. | |
| static std::vector< std::string > | list_valid_methods () |
| static qn::FeatureSet | getFeatureSet () |
| getFeatureSet, static as in SolverAG.m: the RCAT feature envelope of the network arm, qn::ag_feature_set. | |
| static qn::FeatureSet | get_feature_set () |
| static bool | supports (const Composition &) |
| supports(model): a LAL composition has no queueing-network feature set, so the reference answers true (with an empty feature set) and leaves the per-method gate to supportsModelMethod. | |
Public Attributes | |
| AGOptions | options |
SolverAG on a finite LAL composition.
The solver keeps a reference to the composition, as Python does, so agent mutations made after construction are seen by the next query.
Definition at line 70 of file solver_ag.h.
| typedef std::function<Result(const Model&, std::optional<std::size_t>)> line::lal::SolverAG::CTMCBackend |
The explicit-CTMC backend of default/ctmc (Python's module-level lal_ctmc.solve_composition); replaceable so a test can force a refusal.
Definition at line 74 of file solver_ag.h.
|
inlineexplicit |
|
delete |
|
inline |
Definition at line 246 of file solver_ag.h.
References getActTable().
|
inlinestatic |
Definition at line 82 of file solver_ag.h.
|
inline |
Definition at line 260 of file solver_ag.h.
References getAvgTard().
|
inlinestatic |
Definition at line 104 of file solver_ag.h.
References getFeatureSet().
|
inline |
Definition at line 120 of file solver_ag.h.
References getStruct().
|
inline |
Throughputs of several actions, each named as in getAvgAct.
Definition at line 273 of file solver_ag.h.
References getAvgAct().
|
inline |
Definition at line 247 of file solver_ag.h.
References getActTable().
|
inline |
Definition at line 245 of file solver_ag.h.
References getActTable().
|
inline |
Steady-state labelled event rates (getActTable).
Definition at line 244 of file solver_ag.h.
Referenced by actT(), getActionTable(), getActT(), and getAvgAct().
|
inline |
Diagnostics, optionally with a CTMC comparison (getAGDiagnostics).
max_states = nullopt bounds the comparison CTMC only by the dense storage limit of the LAL CTMC path.
Definition at line 294 of file solver_ag.h.
References line::lal::compare_with_ctmc(), line::lal::Result::diagnostics, line::ErrorKind::ErrorKind(), line::lal::Result::method, and line::UnsupportedError::UnsupportedError().
|
inline |
The result container, solving first if needed (getAGResult).
Definition at line 287 of file solver_ag.h.
|
inline |
Queueing-network averages are refused on a general composition (getAvg).
Definition at line 280 of file solver_ag.h.
References line::ErrorKind::ErrorKind(), and line::UnsupportedError::UnsupportedError().
|
inline |
Throughput of one LAL action (named as in SolverCTMC::getAvgAct).
Definition at line 263 of file solver_ag.h.
References getActTable().
Referenced by getActAvg(), getAvgAct(), and getAvgAct().
|
inline |
Definition at line 264 of file solver_ag.h.
References getAvgAct().
|
inline |
Definition at line 269 of file solver_ag.h.
References getAvgAct().
|
inline |
State probabilities (getAvgTable).
Definition at line 241 of file solver_ag.h.
|
inline |
getAvgTard(), inherited by the reference from NetworkSolver: mean class tardiness against the JobClass deadlines, as {Tard, SysTard}.
It solves first when no result is held (getAvgTard.m calls getAvg) and returns what the result carries. A composition declares no JobClass and no deadline, so no LAL result carries a tardiness and both matrices are empty, as the reference returns [] for them.
Definition at line 256 of file solver_ag.h.
Referenced by get_avg_tard().
|
inlinestatic |
getFeatureSet, static as in SolverAG.m: the RCAT feature envelope of the network arm, qn::ag_feature_set.
Every AG method is the same decomposition, so the envelope does not vary by method. A composition is not gated by it; see supports.
Definition at line 103 of file solver_ag.h.
References line::qn::ag_feature_set().
Referenced by get_feature_set().
|
inline |
getStruct: on a Composition the reference returns model.getStruct(), the finite CTMC states, generator and labelled event matrices (Composition::get_struct, which validates the composition first).
Definition at line 119 of file solver_ag.h.
Referenced by get_struct().
|
inlinestatic |
Definition at line 95 of file solver_ag.h.
References listValidMethods().
|
inlinestatic |
Methods available for a finite LAL Composition (listLALMethods).
Definition at line 85 of file solver_ag.h.
Referenced by listValidMethods(), and supportsModelMethod().
|
inlinestatic |
listValidMethods: on a Composition the reference answers listLALMethods (SolverAG.m), so this solver, which only takes one, answers the same list.
Definition at line 94 of file solver_ag.h.
References listLALMethods().
Referenced by list_valid_methods().
|
inline |
The identity: default is gated as itself (resolveMethod).
Definition at line 123 of file solver_ag.h.
References line::lal::AGOptions::method, and options.
Referenced by runAnalyzer().
|
inline |
Run the selected method and store the result (runAnalyzer).
Definition at line 165 of file solver_ag.h.
References line::lal::Result::action_table, line::lal::AGResult::AGResult(), line::lal::ActionTable::attrs, line::lal::StateTable::attrs, line::lal::certify_result(), line::lal::Result::converged, line::lal::Result::diagnostics, line::ErrorKind::ErrorKind(), line::lal::Result::exact, line::lal::TableAttrs::exact, line::lal::Result::fallback_reason, line::lal::AGOptions::group_max_states, line::lal::grouped_solve(), line::lal::AGOptions::groups, line::Error::id(), line::lal::AGOptions::lal_ctmc_max_states, line::lal::AGOptions::max_iter, line::lal::meanfield_solve(), line::lal::model_features(), line::lal::Support::ok, options, line::lal::rcat_solve(), line::lal::Support::reason, resolveMethod(), line::lal::signature(), SolverAG(), line::lal::Result::state_table, supportsModelMethod(), line::lal::AGOptions::tol, line::lal::Result::truncated, and line::UnsupportedError::UnsupportedError().
|
inline |
Replace the explicit-CTMC backend (Python tests monkeypatch it).
Definition at line 310 of file solver_ag.h.
|
inlinestatic |
supports(model): a LAL composition has no queueing-network feature set, so the reference answers true (with an empty feature set) and leaves the per-method gate to supportsModelMethod.
Same convention as the LAL SolverCTMC and SolverSSA.
Definition at line 112 of file solver_ag.h.
|
inline |
Structural gate for the requested method (supportsModelMethod).
Definition at line 126 of file solver_ag.h.
References line::lal::certificate_support(), line::lal::AGOptions::group_max_states, line::lal::group_partition(), line::lal::AGOptions::groups, listLALMethods(), line::lal::model_features(), line::lal::Support::ok, options, line::lal::structural_support(), and line::lal::validate_model().
Referenced by runAnalyzer().
|
inline |
Warnings raised by the last solves, in order (also written to std::cerr).
Definition at line 316 of file solver_ag.h.
| AGOptions line::lal::SolverAG::options |
Definition at line 80 of file solver_ag.h.
Referenced by resolveMethod(), runAnalyzer(), SolverAG(), and supportsModelMethod().