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

Exact finite CTMC enumeration or MDD aggregation of a composition. More...

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

Collaboration diagram for line::lal::SolverCTMC:

Public Member Functions

 SolverCTMC (const Composition &model, CTMCOptions options=CTMCOptions())
 The solver REFERENCES model, as Python's re-reads self.model on every query: a later edit (an added agent or sync, hide, setReward) changes the signature and the next query re-solves.
 SolverCTMC (const Composition &&, CTMCOptions=CTMCOptions())=delete
std::pair< bool, std::optional< std::string > > supportsModelMethod (const std::string &method) const
SolverCTMC & runAnalyzer ()
void reset ()
StateTable getAvgTable ()
ActionTable getActTable ()
ActionTable getActT ()
ActionTable getActionTable ()
double getAvgAct (const ActionSpec &action)
 Throughput of one LAL action (getAvgAct): named by label, by agent.action("x"), by composition.action(...) or by ActionSpec::key(node, EventType[, class]); an open class or a trailing [*] sums the family.
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.
double get_avg_act (const ActionSpec &action)
std::vector< double > get_act_avg (const std::vector< ActionSpec > &actions)
std::pair< std::vector< double >, std::vector< std::string > > getAvgReward ()
 The rewards declared with Composition::setReward, on the stationary law: (R, names).
std::vector< double > getProbSys ()
 Joint stationary distribution in getStateSpace order (MATLAB getProbSys).
Matrix< double > getInfGen ()
std::pair< Matrix< double >, std::vector< Matrix< double > > > getGenerator ()
 The generator and the event filters, in getEventLabels order.
std::vector< std::string > getEventLabels ()
std::pair< std::vector< std::vector< std::string > >, std::vector< std::vector< std::string > > > getStateSpace ()
 Joint state names, one row per state and one column per agent, plus the per-agent columns (Python returns the object array and its column slices).
std::vector< double > getTranProbSys (double t)
 Transient joint distribution pi0 exp(Q t).
const mdd::MddMcdResult< double > & getMDDResult ()
 MDD aggregation details (Python's _result.mdd); throws unless the method run was mdd.
std::string getResultMethod ()
void getAvg () const
void getAvgQLen () const

Static Public Member Functions

static bool supports (const Composition &)

Public Attributes

CTMCOptions options
std::function< Result(const Model &, std::size_t)> ctmc_backend
 Test seam: replaces the explicit CTMC call (Python tests monkeypatch it).

Detailed Description

Exact finite CTMC enumeration or MDD aggregation of a composition.

Methods: default/exact (explicit CTMC; default falls back to mdd on a state-space limit when MDD supports the model) and mdd.

Definition at line 89 of file solvers.h.

Constructor & Destructor Documentation

◆ SolverCTMC() [1/2]

line::lal::SolverCTMC::SolverCTMC ( const Composition & model,
CTMCOptions options = CTMCOptions() )
inlineexplicit

The solver REFERENCES model, as Python's re-reads self.model on every query: a later edit (an added agent or sync, hide, setReward) changes the signature and the next query re-solves.

model must outlive the solver, so a temporary is refused at compile time.

Definition at line 97 of file solvers.h.

References options.

Referenced by runAnalyzer().

◆ SolverCTMC() [2/2]

line::lal::SolverCTMC::SolverCTMC ( const Composition && ,
CTMCOptions = CTMCOptions() )
delete

Member Function Documentation

◆ get_act_avg()

std::vector< double > line::lal::SolverCTMC::get_act_avg ( const std::vector< ActionSpec > & actions)
inline

Definition at line 222 of file solvers.h.

References getActAvg().

◆ get_avg_act()

double line::lal::SolverCTMC::get_avg_act ( const ActionSpec & action)
inline

Definition at line 221 of file solvers.h.

References getAvgAct().

◆ getActAvg()

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

Throughputs of several actions, each named as in getAvgAct.

Definition at line 216 of file solvers.h.

References getAvgAct().

Referenced by get_act_avg().

◆ getActionTable()

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

Definition at line 198 of file solvers.h.

References getActTable().

◆ getActT()

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

Definition at line 197 of file solvers.h.

References getActTable().

◆ getActTable()

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

◆ getAvg()

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

◆ getAvgAct() [1/3]

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

Throughput of one LAL action (getAvgAct): named by label, by agent.action("x"), by composition.action(...) or by ActionSpec::key(node, EventType[, class]); an open class or a trailing [*] sums the family.

Definition at line 206 of file solvers.h.

References getActTable().

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

◆ getAvgAct() [2/3]

double line::lal::SolverCTMC::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 207 of file solvers.h.

References getAvgAct().

◆ getAvgAct() [3/3]

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

Definition at line 212 of file solvers.h.

References getAvgAct().

◆ getAvgQLen()

void line::lal::SolverCTMC::getAvgQLen ( ) const
inline

◆ getAvgReward()

std::pair< std::vector< double >, std::vector< std::string > > line::lal::SolverCTMC::getAvgReward ( )
inline

The rewards declared with Composition::setReward, on the stationary law: (R, names).

Definition at line 225 of file solvers.h.

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

◆ getAvgTable()

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

Definition at line 189 of file solvers.h.

◆ getEventLabels()

std::vector< std::string > line::lal::SolverCTMC::getEventLabels ( )
inline

◆ getGenerator()

std::pair< Matrix< double >, std::vector< Matrix< double > > > line::lal::SolverCTMC::getGenerator ( )
inline

The generator and the event filters, in getEventLabels order.

Definition at line 253 of file solvers.h.

References getInfGen().

◆ getInfGen()

Matrix< double > line::lal::SolverCTMC::getInfGen ( )
inline

Definition at line 245 of file solvers.h.

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

Referenced by getGenerator().

◆ getMDDResult()

const mdd::MddMcdResult< double > & line::lal::SolverCTMC::getMDDResult ( )
inline

MDD aggregation details (Python's _result.mdd); throws unless the method run was mdd.

Definition at line 317 of file solvers.h.

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

◆ getProbSys()

std::vector< double > line::lal::SolverCTMC::getProbSys ( )
inline

Joint stationary distribution in getStateSpace order (MATLAB getProbSys).

Definition at line 237 of file solvers.h.

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

◆ getResultMethod()

std::string line::lal::SolverCTMC::getResultMethod ( )
inline

Definition at line 323 of file solvers.h.

◆ getStateSpace()

std::pair< std::vector< std::vector< std::string > >, std::vector< std::vector< std::string > > > line::lal::SolverCTMC::getStateSpace ( )
inline

Joint state names, one row per state and one column per agent, plus the per-agent columns (Python returns the object array and its column slices).

Definition at line 268 of file solvers.h.

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

◆ getTranProbSys()

std::vector< double > line::lal::SolverCTMC::getTranProbSys ( double t)
inline

◆ reset()

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

Definition at line 187 of file solvers.h.

◆ runAnalyzer()

◆ supports()

bool line::lal::SolverCTMC::supports ( const Composition & )
inlinestatic

Definition at line 103 of file solvers.h.

◆ supportsModelMethod()

std::pair< bool, std::optional< std::string > > line::lal::SolverCTMC::supportsModelMethod ( const std::string & method) const
inline

Member Data Documentation

◆ ctmc_backend

std::function<Result(const Model&, std::size_t)> line::lal::SolverCTMC::ctmc_backend

Test seam: replaces the explicit CTMC call (Python tests monkeypatch it).

Definition at line 331 of file solvers.h.

◆ options

CTMCOptions line::lal::SolverCTMC::options

Definition at line 101 of file solvers.h.

Referenced by runAnalyzer(), and SolverCTMC().


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