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

The shared surface of every solver, Python's NetworkSolver. More...

#include <line/solvers/solver.h>

Inheritance diagram for line::NetworkSolver:
Collaboration diagram for line::NetworkSolver:

Public Member Functions

virtual ~NetworkSolver ()
const std::string & get_name () const
 getName(): the solver's own name, e.g.
const SolverOptions & options () const
 The options this solver was built with.
Network & model () const
 The model this solver was built on.
const AvgTable & avg_table ()
 getAvgTable(): the average table, solving on first demand.
AvgSysTable avg_sys_table ()
 getAvgSysTable(): per-chain system response time and throughput of the same solve.
AvgMetricTable avg_qlen_table ()
 getAvgQLenTable(): avg_table()'s Station, JobClass and QLen columns.
AvgMetricTable avg_util_table ()
 getAvgUtilTable(): avg_table()'s Station, JobClass and Util columns.
AvgMetricTable avg_respt_table ()
 getAvgRespTTable(): avg_table()'s Station, JobClass and RespT columns.
AvgMetricTable avg_tput_table ()
 getAvgTputTable(): avg_table()'s Station, JobClass and Tput columns.
std::vector< double > avg_sys_respt ()
 getAvgSysRespT(): the per-chain system response time column of avg_sys_table.
std::vector< double > avg_sys_tput ()
 getAvgSysTput(): the per-chain system throughput column of avg_sys_table.
AvgChain avg_chain ()
 getAvgChain(): the station table of the same solve aggregated by chain, (nstations x nchains).
Matrix< double > avg_qlen_chain ()
 getAvgQLenChain() and its siblings: one matrix of avg_chain() each.
Matrix< double > avg_util_chain ()
Matrix< double > avg_respt_chain ()
Matrix< double > avg_residt_chain ()
Matrix< double > avg_arvr_chain ()
Matrix< double > avg_tput_chain ()
AvgChainTable avg_chain_table ()
 getAvgChainTable(): avg_chain() as a labelled table, one row per (station, chain).
const AvgTable & run_analyzer ()
 runAnalyzer(): force the solve, returning the table it produced.
std::vector< std::string > list_valid_methods () const
 listValidMethods(): the methods this solver advertises on this model.
bool is_solved () const
 isSolved() / hasResults(): whether a solve has been performed.
bool timed_out ()
 timedOut: whether the last solve stopped early on options.timeout (the metrics are then the interim solution).
void reset ()
 reset(): discard the cached solve.
std::string method_used ()
 getMethodUsed(): the method the solve actually resolved to.
const solvers::CacheMetrics< double > & cache_metrics ()
 What the same solve observed at each Cache node, the data behind getAvgCacheTable() and getAvgItemTable().
std::vector< double > hit_ratio (const std::string &cache)
 cache.getHitRatio() after the solve: the per-class hit probability at the named Cache, NaN for a class that does not read it.
std::vector< double > hit_ratio (const Node &cache)
std::vector< double > miss_ratio (const std::string &cache)
 cache.getMissRatio() after the solve, with hit_ratio's conventions.
std::vector< double > miss_ratio (const Node &cache)
const solvers::FjMetrics< double > & avg_fj ()
 getAvgFJ(): the fork-join section metrics of the same solve, one row per Fork/Join pair (fj_sorted_pairs), one column per class.
AvgFJTable avg_fj_table ()
 getAvgFJTable() (aliases getAvgFJT, fjAvgT, aFJT): the same metrics as a labelled table.
AvgFJTable avg_fjt ()
AvgFJTable fj_avg_t ()
std::vector< Matrix< double > > avg_tard ()
 getAvgTard(): mean class tardiness E[(R - D)^+] against the JobClass deadlines, as {Tard (stations x classes), SysTard (1 x classes)}.

Protected Member Functions

 NetworkSolver (Network &m, const std::string &name, const SolverOptions &o)

Protected Attributes

Network * model_
std::string name_
SolverOptions opts_
AvgTable table_
solvers::CacheMetrics< double > cache_
solvers::FjMetrics< double > fj_
solvers::LossnInfo lossn_
 result.LossN: loss-network inputs of the last NC solve, else empty
bool solved_ = false

Detailed Description

The shared surface of every solver, Python's NetworkSolver.

The solve is performed on first demand and cached, which is what hasResults/is_solved reports; reset() discards it.

Definition at line 141 of file solver.h.

Constructor & Destructor Documentation

◆ ~NetworkSolver()

virtual line::NetworkSolver::~NetworkSolver ( )
inlinevirtual

Definition at line 143 of file solver.h.

◆ NetworkSolver()

Member Function Documentation

◆ avg_arvr_chain()

Matrix< double > line::NetworkSolver::avg_arvr_chain ( )
inline

Definition at line 177 of file solver.h.

References line::AvgChain::AN, and avg_chain().

◆ avg_chain()

◆ avg_chain_table()

◆ avg_fj()

const solvers::FjMetrics< double > & line::NetworkSolver::avg_fj ( )

getAvgFJ(): the fork-join section metrics of the same solve, one row per Fork/Join pair (fj_sorted_pairs), one column per class.

Empty without a pair, or when the solver computes none.

Definition at line 1192 of file solver_facade.cpp.

References avg_table(), and fj_.

Referenced by avg_fj_table().

◆ avg_fj_table()

AvgFJTable line::NetworkSolver::avg_fj_table ( )

getAvgFJTable() (aliases getAvgFJT, fjAvgT, aFJT): the same metrics as a labelled table.

Definition at line 1205 of file solver_facade.cpp.

References avg_fj(), line::AvgFJTable::FJQLen, line::AvgFJTable::FJRespT, line::AvgFJTable::FJTput, line::AvgFJTable::Fork, line::qn::Network< T >::get_struct(), line::AvgFJTable::JobClass, line::AvgFJTable::Join, and model_.

Referenced by avg_fjt(), and fj_avg_t().

◆ avg_fjt()

AvgFJTable line::NetworkSolver::avg_fjt ( )
inline

Definition at line 226 of file solver.h.

References avg_fj_table().

◆ avg_qlen_chain()

Matrix< double > line::NetworkSolver::avg_qlen_chain ( )
inline

getAvgQLenChain() and its siblings: one matrix of avg_chain() each.

Definition at line 173 of file solver.h.

References avg_chain(), and line::AvgChain::QN.

◆ avg_qlen_table()

AvgMetricTable line::NetworkSolver::avg_qlen_table ( )
inline

getAvgQLenTable(): avg_table()'s Station, JobClass and QLen columns.

Definition at line 157 of file solver.h.

References line::avg_metric_view(), and avg_table().

◆ avg_residt_chain()

Matrix< double > line::NetworkSolver::avg_residt_chain ( )
inline

Definition at line 176 of file solver.h.

References avg_chain(), and line::AvgChain::WN.

◆ avg_respt_chain()

Matrix< double > line::NetworkSolver::avg_respt_chain ( )
inline

Definition at line 175 of file solver.h.

References avg_chain(), and line::AvgChain::RN.

◆ avg_respt_table()

AvgMetricTable line::NetworkSolver::avg_respt_table ( )
inline

getAvgRespTTable(): avg_table()'s Station, JobClass and RespT columns.

Definition at line 161 of file solver.h.

References line::avg_metric_view(), and avg_table().

◆ avg_sys_respt()

std::vector< double > line::NetworkSolver::avg_sys_respt ( )
inline

getAvgSysRespT(): the per-chain system response time column of avg_sys_table.

Definition at line 166 of file solver.h.

References avg_sys_table(), and line::AvgSysTable::SysRespT.

◆ avg_sys_table()

◆ avg_sys_tput()

std::vector< double > line::NetworkSolver::avg_sys_tput ( )
inline

getAvgSysTput(): the per-chain system throughput column of avg_sys_table.

Definition at line 168 of file solver.h.

References avg_sys_table(), and line::AvgSysTable::SysTput.

◆ avg_table()

◆ avg_tard()

std::vector< Matrix< double > > line::NetworkSolver::avg_tard ( )

getAvgTard(): mean class tardiness E[(R - D)^+] against the JobClass deadlines, as {Tard (stations x classes), SysTard (1 x classes)}.

Computed exactly by MVA on a single-station priority M/M/c queue (Hafizoglu, Gel and Keskinocak 2013); both empty otherwise.

Definition at line 1197 of file solver_facade.cpp.

References line::qn::Network< T >::get_struct(), method_used(), model_, name_, line::mva::solver_mva_qsys_prio_tardiness(), line::mva::QsysPrioTardiness::SysTard, and line::mva::QsysPrioTardiness::Tard.

◆ avg_tput_chain()

Matrix< double > line::NetworkSolver::avg_tput_chain ( )
inline

Definition at line 178 of file solver.h.

References avg_chain(), and line::AvgChain::TN.

◆ avg_tput_table()

AvgMetricTable line::NetworkSolver::avg_tput_table ( )
inline

getAvgTputTable(): avg_table()'s Station, JobClass and Tput columns.

Definition at line 163 of file solver.h.

References line::avg_metric_view(), and avg_table().

◆ avg_util_chain()

Matrix< double > line::NetworkSolver::avg_util_chain ( )
inline

Definition at line 174 of file solver.h.

References avg_chain(), and line::AvgChain::UN.

◆ avg_util_table()

AvgMetricTable line::NetworkSolver::avg_util_table ( )
inline

getAvgUtilTable(): avg_table()'s Station, JobClass and Util columns.

Definition at line 159 of file solver.h.

References line::avg_metric_view(), and avg_table().

◆ cache_metrics()

const solvers::CacheMetrics< double > & line::NetworkSolver::cache_metrics ( )

What the same solve observed at each Cache node, the data behind getAvgCacheTable() and getAvgItemTable().

A Cache is not a station, so none of this reaches avg_table(). Empty on a model without a Cache; a field the engine did not compute is an empty vector.

Definition at line 1187 of file solver_facade.cpp.

References avg_table(), and cache_.

Referenced by hit_ratio(), and miss_ratio().

◆ fj_avg_t()

AvgFJTable line::NetworkSolver::fj_avg_t ( )
inline

Definition at line 227 of file solver.h.

References avg_fj_table().

◆ get_name()

const std::string & line::NetworkSolver::get_name ( ) const
inline

getName(): the solver's own name, e.g.

"MVA".

Definition at line 146 of file solver.h.

References name_.

Referenced by line::SolverLDES::init_from_solver().

◆ hit_ratio() [1/2]

std::vector< double > line::NetworkSolver::hit_ratio ( const Node & cache)

Definition at line 1283 of file solver_facade.cpp.

References hit_ratio().

◆ hit_ratio() [2/2]

std::vector< double > line::NetworkSolver::hit_ratio ( const std::string & cache)

cache.getHitRatio() after the solve: the per-class hit probability at the named Cache, NaN for a class that does not read it.

Throws when the solver measured none there.

Definition at line 1275 of file solver_facade.cpp.

References cache_metrics(), and name_.

Referenced by hit_ratio().

◆ is_solved()

bool line::NetworkSolver::is_solved ( ) const
inline

isSolved() / hasResults(): whether a solve has been performed.

Definition at line 186 of file solver.h.

References solved_.

◆ list_valid_methods()

◆ method_used()

std::string line::NetworkSolver::method_used ( )

getMethodUsed(): the method the solve actually resolved to.

Definition at line 993 of file solver_facade.cpp.

References avg_table(), and line::AvgTable::method.

Referenced by avg_tard().

◆ miss_ratio() [1/2]

std::vector< double > line::NetworkSolver::miss_ratio ( const Node & cache)

Definition at line 1285 of file solver_facade.cpp.

References miss_ratio().

◆ miss_ratio() [2/2]

std::vector< double > line::NetworkSolver::miss_ratio ( const std::string & cache)

cache.getMissRatio() after the solve, with hit_ratio's conventions.

Definition at line 1279 of file solver_facade.cpp.

References cache_metrics(), and name_.

Referenced by miss_ratio().

◆ model()

Network & line::NetworkSolver::model ( ) const
inline

The model this solver was built on.

Definition at line 150 of file solver.h.

References model_.

Referenced by line::wfn::WorkflowNet::get_case_metrics(), line::SolverAUTO::supports(), and line::SolverLDES::supports().

◆ options()

const SolverOptions & line::NetworkSolver::options ( ) const
inline

The options this solver was built with.

Definition at line 148 of file solver.h.

References opts_.

Referenced by line::SolverLDES::init_from_solver().

◆ reset()

void line::NetworkSolver::reset ( )
inline

reset(): discard the cached solve.

Definition at line 193 of file solver.h.

References cache_, fj_, lossn_, solved_, and table_.

Referenced by line::SolverLDES::init_from_jobs(), and line::SolverLDES::init_from_solver().

◆ run_analyzer()

const AvgTable & line::NetworkSolver::run_analyzer ( )
inline

runAnalyzer(): force the solve, returning the table it produced.

Definition at line 182 of file solver.h.

References avg_table().

◆ timed_out()

bool line::NetworkSolver::timed_out ( )
inline

timedOut: whether the last solve stopped early on options.timeout (the metrics are then the interim solution).

Forces the solve.

Definition at line 191 of file solver.h.

References avg_table(), and line::AvgTable::timed_out.

Member Data Documentation

◆ cache_

solvers::CacheMetrics<double> line::NetworkSolver::cache_
protected

Definition at line 243 of file solver.h.

Referenced by avg_table(), cache_metrics(), and reset().

◆ fj_

solvers::FjMetrics<double> line::NetworkSolver::fj_
protected

Definition at line 244 of file solver.h.

Referenced by avg_fj(), avg_table(), and reset().

◆ lossn_

solvers::LossnInfo line::NetworkSolver::lossn_
protected

result.LossN: loss-network inputs of the last NC solve, else empty

Definition at line 245 of file solver.h.

Referenced by avg_table(), line::SolverNC::lossn_info(), and reset().

◆ model_

Network* line::NetworkSolver::model_
protected

Definition at line 239 of file solver.h.

Referenced by line::SolverCTMC::acc_reward(), line::SolverLDES::avg_busy_period(), avg_chain(), avg_chain_table(), avg_fj_table(), line::SolverNC::avg_link_table(), avg_sys_table(), avg_table(), avg_tard(), line::SolverAUTO::ba_solver(), line::SolverBA::bounds_table(), line::SolverAUTO::candidate_solver_names(), line::SolverCTMC::cdf_first_passt(), line::SolverCTMC::cdf_first_passt(), line::SolverAUTO::cdf_respt(), line::SolverCTMC::cdf_respt(), line::SolverFLD::cdf_respt(), line::SolverJMT::cdf_respt(), line::SolverLDES::cdf_respt(), line::SolverAUTO::choose_solver(), line::SolverAUTO::ctmc_solver(), line::SolverAUTO::find_solver(), line::SolverCTMC::first_passt_moments(), line::SolverCTMC::first_passt_moments(), line::SolverAUTO::fld_solver(), line::SolverCTMC::generator(), line::SolverLDES::get_struct(), line::SolverLDES::init_from_solver(), list_valid_methods(), line::SolverCTMC::marg_aggr(), model(), line::SolverAUTO::nc_solver(), NetworkSolver(), line::SolverLDES::perct_respt(), line::SolverLDES::perct_respt(), line::SolverAUTO::prob_aggr(), line::SolverCTMC::prob_aggr(), line::SolverJMT::prob_aggr(), line::SolverAUTO::proposed_solver_names(), line::SolverJMT::sample(), line::SolverLDES::sample(), line::SolverLDES::sample_aggr(), line::SolverLDES::sample_sys(), line::SolverLDES::sample_sys_aggr(), line::SolverCTMC::state_space(), line::SolverCTMC::state_space_aggr(), line::SolverCTMC::symbolic_solution(), line::SolverAUTO::tran_avg(), line::SolverFLD::tran_avg(), and line::SolverJMT::tran_avg().

◆ name_

std::string line::NetworkSolver::name_
protected

◆ opts_

SolverOptions line::NetworkSolver::opts_
protected

Definition at line 241 of file solver.h.

Referenced by line::SolverCTMC::acc_reward(), line::SolverCTMC::acc_reward(), line::SolverLDES::avg_busy_period(), line::SolverLDES::avg_reward(), avg_table(), line::SolverAUTO::ba_solver(), line::SolverBA::bounds_table(), line::SolverCTMC::cdf_first_passt(), line::SolverCTMC::cdf_first_passt(), line::SolverAUTO::cdf_respt(), line::SolverCTMC::cdf_respt(), line::SolverFLD::cdf_respt(), line::SolverJMT::cdf_respt(), line::SolverLDES::cdf_respt(), line::SolverAUTO::choose_solver(), line::SolverAUTO::ctmc_solver(), line::SolverCTMC::first_passt_moments(), line::SolverCTMC::first_passt_moments(), line::SolverAUTO::fld_solver(), line::SolverCTMC::generator(), line::SolverLDES::init_from_jobs(), line::SolverLDES::init_from_solver(), line::SolverCTMC::marg_aggr(), line::SolverAUTO::nc_solver(), NetworkSolver(), options(), line::SolverLDES::perct_respt(), line::SolverLDES::prob(), line::SolverAUTO::prob_aggr(), line::SolverCTMC::prob_aggr(), line::SolverJMT::prob_aggr(), line::SolverLDES::prob_aggr(), line::SolverLDES::prob_sys(), line::SolverAUTO::proposed_solver_names(), line::SolverJMT::sample(), line::SolverLDES::sample(), line::SolverLDES::sample_aggr(), line::SolverLDES::sample_sys(), line::SolverLDES::sample_sys_aggr(), line::SolverCTMC::state_space(), line::SolverCTMC::state_space_aggr(), line::SolverCTMC::symbolic_solution(), line::SolverAUTO::tran_avg(), line::SolverFLD::tran_avg(), line::SolverJMT::tran_avg(), line::SolverLDES::tran_avg(), and line::SolverLDES::tran_reward().

◆ solved_

bool line::NetworkSolver::solved_ = false
protected

◆ table_

AvgTable line::NetworkSolver::table_
protected

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