LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::lal::SolverAG Class Reference

SolverAG on a finite LAL composition. More...

#include <line/lang/lal/solver_ag.h>

Collaboration diagram for line::lal::SolverAG:

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

Detailed Description

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.

Member Typedef Documentation

◆ CTMCBackend

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.

Constructor & Destructor Documentation

◆ SolverAG() [1/2]

line::lal::SolverAG::SolverAG ( const Composition & model,
AGOptions options = AGOptions() )
inlineexplicit

Definition at line 76 of file solver_ag.h.

References options.

Referenced by runAnalyzer().

◆ SolverAG() [2/2]

line::lal::SolverAG::SolverAG ( const Composition && ,
AGOptions = AGOptions() )
delete

Member Function Documentation

◆ actT()

ActionTable line::lal::SolverAG::actT ( )
inline

Definition at line 246 of file solver_ag.h.

References getActTable().

◆ defaultOptions()

AGOptions line::lal::SolverAG::defaultOptions ( )
inlinestatic

Definition at line 82 of file solver_ag.h.

◆ get_avg_tard()

std::vector< Matrix< double > > line::lal::SolverAG::get_avg_tard ( )
inline

Definition at line 260 of file solver_ag.h.

References getAvgTard().

◆ get_feature_set()

qn::FeatureSet line::lal::SolverAG::get_feature_set ( )
inlinestatic

Definition at line 104 of file solver_ag.h.

References getFeatureSet().

◆ get_struct()

Compiled line::lal::SolverAG::get_struct ( ) const
inline

Definition at line 120 of file solver_ag.h.

References getStruct().

◆ getActAvg()

std::vector< double > line::lal::SolverAG::getActAvg ( const std::vector< ActionSpec > & actions)
inline

Throughputs of several actions, each named as in getAvgAct.

Definition at line 273 of file solver_ag.h.

References getAvgAct().

◆ getActionTable()

ActionTable line::lal::SolverAG::getActionTable ( )
inline

Definition at line 247 of file solver_ag.h.

References getActTable().

◆ getActT()

ActionTable line::lal::SolverAG::getActT ( )
inline

Definition at line 245 of file solver_ag.h.

References getActTable().

◆ getActTable()

ActionTable line::lal::SolverAG::getActTable ( )
inline

Steady-state labelled event rates (getActTable).

Definition at line 244 of file solver_ag.h.

Referenced by actT(), getActionTable(), getActT(), and getAvgAct().

◆ getAGDiagnostics()

nlohmann::json line::lal::SolverAG::getAGDiagnostics ( bool compare_ctmc = false,
std::optional< std::size_t > max_states = std::nullopt )
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().

◆ getAGResult()

const AGResult & line::lal::SolverAG::getAGResult ( )
inline

The result container, solving first if needed (getAGResult).

Definition at line 287 of file solver_ag.h.

◆ getAvg()

void line::lal::SolverAG::getAvg ( ) const
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().

◆ getAvgAct() [1/3]

double line::lal::SolverAG::getAvgAct ( const ActionSpec & action)
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().

◆ getAvgAct() [2/3]

double line::lal::SolverAG::getAvgAct ( const std::string & node,
lang::EventType event,
const std::optional< std::string > & jobclass = std::nullopt,
const std::optional< std::string > & mode = std::nullopt )
inline

Definition at line 264 of file solver_ag.h.

References getAvgAct().

◆ getAvgAct() [3/3]

double line::lal::SolverAG::getAvgAct ( std::size_t node,
lang::EventType event,
std::size_t jobclass = 0 )
inline

Definition at line 269 of file solver_ag.h.

References getAvgAct().

◆ getAvgTable()

StateTable line::lal::SolverAG::getAvgTable ( )
inline

State probabilities (getAvgTable).

Definition at line 241 of file solver_ag.h.

◆ getAvgTard()

std::vector< Matrix< double > > line::lal::SolverAG::getAvgTard ( )
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().

◆ getFeatureSet()

qn::FeatureSet line::lal::SolverAG::getFeatureSet ( )
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().

◆ getStruct()

Compiled line::lal::SolverAG::getStruct ( ) const
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().

◆ list_valid_methods()

std::vector< std::string > line::lal::SolverAG::list_valid_methods ( )
inlinestatic

Definition at line 95 of file solver_ag.h.

References listValidMethods().

◆ listLALMethods()

std::vector< std::string > line::lal::SolverAG::listLALMethods ( )
inlinestatic

Methods available for a finite LAL Composition (listLALMethods).

Definition at line 85 of file solver_ag.h.

Referenced by listValidMethods(), and supportsModelMethod().

◆ listValidMethods()

std::vector< std::string > line::lal::SolverAG::listValidMethods ( )
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().

◆ resolveMethod()

std::string line::lal::SolverAG::resolveMethod ( ) const
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().

◆ runAnalyzer()

◆ setCTMCBackend()

void line::lal::SolverAG::setCTMCBackend ( CTMCBackend backend)
inline

Replace the explicit-CTMC backend (Python tests monkeypatch it).

Definition at line 310 of file solver_ag.h.

◆ supports()

bool line::lal::SolverAG::supports ( const Composition & )
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.

◆ supportsModelMethod()

Support line::lal::SolverAG::supportsModelMethod ( const std::string & method) const
inline

◆ warnings()

const std::vector< std::string > & line::lal::SolverAG::warnings ( ) const
inline

Warnings raised by the last solves, in order (also written to std::cerr).

Definition at line 316 of file solver_ag.h.

Member Data Documentation

◆ options

AGOptions line::lal::SolverAG::options

Definition at line 80 of file solver_ag.h.

Referenced by resolveMethod(), runAnalyzer(), SolverAG(), and supportsModelMethod().


The documentation for this class was generated from the following file: