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

SolverMAM on a LAL composition. More...

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

Collaboration diagram for line::lal::SolverMAM:

Public Types

typedef std::pair< bool, std::string > Support
typedef std::function< MamResult(const Composition &, double, double, const std::optional< std::string > &)> FiniteQBDBackend
 The Cartesian finite-QBD backend (Python's module-level lal_qbd.solve_composition); replaceable so a test can intercept it.

Public Member Functions

 SolverMAM (const Composition &model, MAMOptions options=MAMOptions())
 SolverMAM (const Composition &model, const std::string &method, const nlohmann::json &kwargs=nlohmann::json::object())
 SolverMAM(model, method, **kwargs) with keyword arguments as a json object.
 SolverMAM (const Composition &&, MAMOptions=MAMOptions())=delete
 SolverMAM (const Composition &&, const std::string &, const nlohmann::json &=nlohmann::json::object())=delete
std::string getName () const
void reset ()
 Clear the stored result (reset).
bool hasResult () const
 Whether a result is stored (Python solver.result is not None).
Support supportsModelMethod (const std::string &method) const
 Method-aware structural gate (supportsModelMethod); the reason is empty when supported.
SolverMAM & runAnalyzer ()
 Run the selected lowering and store the result (runAnalyzer).
StateTable getAvgTable ()
 Agent-state probabilities (getAvgTable).
ActionTable getActTable ()
 Labelled event throughputs (getActTable and its aliases).
ActionTable get_act_table ()
ActionTable act_table ()
ActionTable GetActTable ()
ActionTable getActT ()
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 ()
ActionTable actT ()
ActionTable getActionTable ()
double getAvgAct (const ActionSpec &action)
 Throughput of one LAL action (named as in SolverCTMC::getAvgAct, against the original composition).
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.
const Composition & model () const
 The composition the solver analyzes: the lowered one when an embedded network was lowered.
QueueTable getQueueTable ()
 Queue measures of unchanged structured queue declarations (getQueueTable).
QueueTable get_queue_table ()
nlohmann::json getCompositionCapabilities () const
 The binding described before solving, with runtime conditions (getCompositionCapabilities).
nlohmann::json get_composition_capabilities () const
nlohmann::json getMAMDiagnostics (bool compare_ctmc=false, std::size_t max_states=1000)
 Diagnostics, optionally compared with the finite CTMC (getMAMDiagnostics).
nlohmann::json get_mam_diagnostics (bool compare_ctmc=false, std::size_t max_states=1000)
void getAvg () const
 Queueing-network averages are refused on a composition (getAvg).
const MamResult & getMAMResult ()
 The result container, solving first if needed (getMAMResult).
void setFiniteQBDBackend (FiniteQBDBackend backend)
 Replace the Cartesian finite-QBD backend (Python tests monkeypatch it).
void setNativeDecSourceBackend (NativeDecSourceBackend backend)
 Replace the native dec.source solve behind the MAP-network and marked-thinning decompositions (Python tests monkeypatch SolverMAM.getAvgTable); an empty function restores the native solver.

Static Public Member Functions

static MAMOptions defaultOptions ()
static std::vector< std::string > listLALMethods ()
 Methods available for a LAL Composition (MATLAB SolverMAM.listLALMethods).

Public Attributes

MAMOptions options

Detailed Description

SolverMAM on a LAL composition.

Definition at line 231 of file solver_mam.h.

Member Typedef Documentation

◆ FiniteQBDBackend

typedef std::function<MamResult(const Composition&, double, double, const std::optional<std::string>&)> line::lal::SolverMAM::FiniteQBDBackend

The Cartesian finite-QBD backend (Python's module-level lal_qbd.solve_composition); replaceable so a test can intercept it.

Definition at line 237 of file solver_mam.h.

◆ Support

typedef std::pair<bool, std::string> line::lal::SolverMAM::Support

Definition at line 233 of file solver_mam.h.

Constructor & Destructor Documentation

◆ SolverMAM() [1/4]

line::lal::SolverMAM::SolverMAM ( const Composition & model,
MAMOptions options = MAMOptions() )
inlineexplicit

Definition at line 239 of file solver_mam.h.

References model(), and options.

Referenced by runAnalyzer().

◆ SolverMAM() [2/4]

line::lal::SolverMAM::SolverMAM ( const Composition & model,
const std::string & method,
const nlohmann::json & kwargs = nlohmann::json::object() )
inline

SolverMAM(model, method, **kwargs) with keyword arguments as a json object.

Definition at line 244 of file solver_mam.h.

References model(), and options.

◆ SolverMAM() [3/4]

line::lal::SolverMAM::SolverMAM ( const Composition && ,
MAMOptions = MAMOptions() )
delete

◆ SolverMAM() [4/4]

line::lal::SolverMAM::SolverMAM ( const Composition && ,
const std::string & ,
const nlohmann::json & = nlohmann::json::object() )
delete

Member Function Documentation

◆ act_table()

ActionTable line::lal::SolverMAM::act_table ( )
inline

Definition at line 474 of file solver_mam.h.

References getActTable().

◆ actT()

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

Definition at line 490 of file solver_mam.h.

References getActTable().

◆ defaultOptions()

MAMOptions line::lal::SolverMAM::defaultOptions ( )
inlinestatic

Definition at line 253 of file solver_mam.h.

◆ get_act_table()

ActionTable line::lal::SolverMAM::get_act_table ( )
inline

Definition at line 473 of file solver_mam.h.

References getActTable().

◆ get_avg_tard()

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

Definition at line 489 of file solver_mam.h.

References getAvgTard().

◆ get_composition_capabilities()

nlohmann::json line::lal::SolverMAM::get_composition_capabilities ( ) const
inline

Definition at line 676 of file solver_mam.h.

References getCompositionCapabilities().

◆ get_mam_diagnostics()

nlohmann::json line::lal::SolverMAM::get_mam_diagnostics ( bool compare_ctmc = false,
std::size_t max_states = 1000 )
inline

Definition at line 751 of file solver_mam.h.

References getMAMDiagnostics().

◆ get_queue_table()

QueueTable line::lal::SolverMAM::get_queue_table ( )
inline

Definition at line 584 of file solver_mam.h.

References getQueueTable().

◆ getActAvg()

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

Throughputs of several actions, each named as in getAvgAct.

Definition at line 504 of file solver_mam.h.

References getAvgAct().

◆ getActionTable()

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

Definition at line 491 of file solver_mam.h.

References getActTable().

◆ getActT()

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

Definition at line 476 of file solver_mam.h.

References getActTable().

◆ GetActTable()

ActionTable line::lal::SolverMAM::GetActTable ( )
inline

Definition at line 475 of file solver_mam.h.

References getActTable().

◆ getActTable()

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

Labelled event throughputs (getActTable and its aliases).

Definition at line 472 of file solver_mam.h.

Referenced by act_table(), actT(), get_act_table(), getActionTable(), getActT(), GetActTable(), and getAvgAct().

◆ getAvg()

void line::lal::SolverMAM::getAvg ( ) const
inline

Queueing-network averages are refused on a composition (getAvg).

Definition at line 756 of file solver_mam.h.

References line::ErrorKind::ErrorKind(), and line::UnsupportedError::UnsupportedError().

◆ getAvgAct() [1/3]

double line::lal::SolverMAM::getAvgAct ( const ActionSpec & action)
inline

Throughput of one LAL action (named as in SolverCTMC::getAvgAct, against the original composition).

Definition at line 494 of file solver_mam.h.

References getActTable().

Referenced by getActAvg(), getAvgAct(), and getAvgAct().

◆ getAvgAct() [2/3]

double line::lal::SolverMAM::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 495 of file solver_mam.h.

References getAvgAct().

◆ getAvgAct() [3/3]

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

Definition at line 500 of file solver_mam.h.

References getAvgAct().

◆ getAvgTable()

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

Agent-state probabilities (getAvgTable).

Definition at line 469 of file solver_mam.h.

◆ getAvgTard()

std::vector< Matrix< double > > line::lal::SolverMAM::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 485 of file solver_mam.h.

Referenced by get_avg_tard().

◆ getCompositionCapabilities()

◆ getMAMDiagnostics()

nlohmann::json line::lal::SolverMAM::getMAMDiagnostics ( bool compare_ctmc = false,
std::size_t max_states = 1000 )
inline

◆ getMAMResult()

const MamResult & line::lal::SolverMAM::getMAMResult ( )
inline

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

Definition at line 761 of file solver_mam.h.

Referenced by line::lal::parallel_qbd().

◆ getName()

std::string line::lal::SolverMAM::getName ( ) const
inline

Definition at line 254 of file solver_mam.h.

◆ getQueueTable()

◆ hasResult()

bool line::lal::SolverMAM::hasResult ( ) const
inline

Whether a result is stored (Python solver.result is not None).

Definition at line 268 of file solver_mam.h.

◆ listLALMethods()

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

Methods available for a LAL Composition (MATLAB SolverMAM.listLALMethods).

Definition at line 257 of file solver_mam.h.

◆ model()

const Composition & line::lal::SolverMAM::model ( ) const
inline

The composition the solver analyzes: the lowered one when an embedded network was lowered.

Definition at line 511 of file solver_mam.h.

Referenced by SolverMAM(), and SolverMAM().

◆ reset()

void line::lal::SolverMAM::reset ( )
inline

Clear the stored result (reset).

Definition at line 262 of file solver_mam.h.

Referenced by setFiniteQBDBackend(), and setNativeDecSourceBackend().

◆ runAnalyzer()

SolverMAM & line::lal::SolverMAM::runAnalyzer ( )
inline

Run the selected lowering and store the result (runAnalyzer).

Definition at line 342 of file solver_mam.h.

References line::lal::Result::action_table, line::lal::Model::agent(), line::lal::Model::agents, line::lal::MAMOptions::arith, line::lal::ActionTable::attrs, line::lal::StateTable::attrs, line::lal::MAMOptions::config, line::lal::MAMOptions::cutoff, line::ErrorKind::ErrorKind(), line::lal::Result::fallback_reason, line::lal::TableAttrs::fallback_reason, line::Error::id(), line::lal::infinite_qbd(), line::InputError::InputError(), line::lal::jackson(), line::lal::MAMOptions::lal_compress_method, line::lal::MAMOptions::lal_fit_time, line::lal::MAMOptions::lal_fit_tolerance, line::lal::MAMOptions::lal_level_agent, line::lal::MAMOptions::lal_max_phases, line::lal::MAMOptions::lal_max_states, line::lal::MAMOptions::lal_traffic_method, line::lal::MAMOptions::lang, line::lal::map_network(), line::lal::marked_thinning(), line::lal::MAMOptions::max_iter, line::lal::MAMOptions::method, line::lal::AgentRecord::name, options, line::lal::parallel_qbd(), line::lal::qbd_structure(), line::lal::MamResult::queue_measures, line::lal::MamResult::raw_action_table, line::lal::reachable_qbd(), line::lal::recognize_jackson(), line::lal::recognize_map(), line::lal::recognize_parallel(), line::lal::relabel_action_table(), line::lal::signature(), line::lal::solve_reduced(), SolverMAM(), line::lal::Result::state_table, line::lal::AgentRecord::states, supportsModelMethod(), line::lal::MAMOptions::timeout, line::lal::MAMOptions::timespan, line::lal::MAMOptions::tol, line::lal::MamResult::traffic, and line::UnsupportedError::UnsupportedError().

◆ setFiniteQBDBackend()

void line::lal::SolverMAM::setFiniteQBDBackend ( FiniteQBDBackend backend)
inline

Replace the Cartesian finite-QBD backend (Python tests monkeypatch it).

Definition at line 764 of file solver_mam.h.

References reset().

◆ setNativeDecSourceBackend()

void line::lal::SolverMAM::setNativeDecSourceBackend ( NativeDecSourceBackend backend)
inline

Replace the native dec.source solve behind the MAP-network and marked-thinning decompositions (Python tests monkeypatch SolverMAM.getAvgTable); an empty function restores the native solver.

Definition at line 774 of file solver_mam.h.

References reset().

◆ supportsModelMethod()

Member Data Documentation

◆ options

MAMOptions line::lal::SolverMAM::options

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