![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The shared surface of every solver, Python's NetworkSolver. More...
#include <line/solvers/solver.h>
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. | |
| 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 () |
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_ |
| bool | solved_ = false |
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.
|
inlinevirtual |
|
inlineprotected |
Definition at line 206 of file solver.h.
References model_, name_, and opts_.
Referenced by line::SolverLDES::init_from_solver(), line::SolverAUTO::SolverAUTO(), line::SolverBA::SolverBA(), line::SolverBA::SolverBA(), line::SolverCTMC::SolverCTMC(), line::SolverCTMC::SolverCTMC(), line::SolverFLD::SolverFLD(), line::SolverFLD::SolverFLD(), line::SolverJMT::SolverJMT(), line::SolverJMT::SolverJMT(), line::SolverLDES::SolverLDES(), line::SolverLDES::SolverLDES(), and line::SolverLDES::SolverLDES().
|
inline |
Definition at line 159 of file solver.h.
References line::AvgChain::AN, and avg_chain().
| AvgChain line::NetworkSolver::avg_chain | ( | ) |
getAvgChain(): the station table of the same solve aggregated by chain, (nstations x nchains).
Definition at line 1091 of file solver_facade.cpp.
References line::AvgChain::AN, line::solvers::ChainResult< T >::AN, avg_table(), line::qn::Network< T >::get_struct(), model_, line::AvgChain::QN, line::solvers::ChainResult< T >::QN, line::AvgChain::RN, line::solvers::ChainResult< T >::RN, line::solvers::solver_get_avg_chain(), line::AvgChain::TN, line::solvers::ChainResult< T >::TN, line::AvgChain::UN, line::solvers::ChainResult< T >::UN, line::AvgChain::WN, and line::solvers::ChainResult< T >::WN.
Referenced by avg_arvr_chain(), avg_chain_table(), avg_qlen_chain(), avg_residt_chain(), avg_respt_chain(), avg_tput_chain(), and avg_util_chain().
| AvgChainTable line::NetworkSolver::avg_chain_table | ( | ) |
getAvgChainTable(): avg_chain() as a labelled table, one row per (station, chain).
Definition at line 1105 of file solver_facade.cpp.
References line::AvgChain::AN, line::AvgChainTable::ArvR, avg_chain(), line::AvgChainTable::Chain, line::solvers::chain_class_labels(), line::solvers::chain_names(), line::qn::Network< T >::get_struct(), line::AvgChainTable::JobClasses, model_, line::AvgChainTable::QLen, line::AvgChain::QN, line::AvgChainTable::ResidT, line::AvgChainTable::RespT, line::AvgChain::RN, line::AvgChainTable::Station, line::AvgChain::TN, line::AvgChainTable::Tput, line::AvgChain::UN, line::AvgChainTable::Util, and line::AvgChain::WN.
| 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 1132 of file solver_facade.cpp.
References avg_table(), and fj_.
Referenced by avg_fj_table().
| AvgFJTable line::NetworkSolver::avg_fj_table | ( | ) |
getAvgFJTable() (aliases getAvgFJT, fjAvgT, aFJT): the same metrics as a labelled table.
Definition at line 1137 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().
|
inline |
Definition at line 202 of file solver.h.
References avg_fj_table().
|
inline |
getAvgQLenChain() and its siblings: one matrix of avg_chain() each.
Definition at line 155 of file solver.h.
References avg_chain(), and line::AvgChain::QN.
|
inline |
getAvgQLenTable(): avg_table()'s Station, JobClass and QLen columns.
Definition at line 139 of file solver.h.
References line::avg_metric_view(), and avg_table().
|
inline |
Definition at line 158 of file solver.h.
References avg_chain(), and line::AvgChain::WN.
|
inline |
Definition at line 157 of file solver.h.
References avg_chain(), and line::AvgChain::RN.
|
inline |
getAvgRespTTable(): avg_table()'s Station, JobClass and RespT columns.
Definition at line 143 of file solver.h.
References line::avg_metric_view(), and avg_table().
|
inline |
getAvgSysRespT(): the per-chain system response time column of avg_sys_table.
Definition at line 148 of file solver.h.
References avg_sys_table(), and line::AvgSysTable::SysRespT.
| AvgSysTable line::NetworkSolver::avg_sys_table | ( | ) |
getAvgSysTable(): per-chain system response time and throughput of the same solve.
Definition at line 1078 of file solver_facade.cpp.
References avg_table(), line::AvgSysTable::Chain, line::solvers::chain_class_labels(), line::solvers::chain_names(), line::solvers::SysResult< T >::CN, line::qn::Network< T >::get_struct(), line::AvgSysTable::JobClasses, model_, line::solvers::solver_get_avg_sys(), line::AvgSysTable::SysRespT, line::AvgSysTable::SysTput, and line::solvers::SysResult< T >::XN.
Referenced by avg_sys_respt(), and avg_sys_tput().
|
inline |
getAvgSysTput(): the per-chain system throughput column of avg_sys_table.
Definition at line 150 of file solver.h.
References avg_sys_table(), and line::AvgSysTable::SysTput.
| const AvgTable & line::NetworkSolver::avg_table | ( | ) |
getAvgTable(): the average table, solving on first demand.
Definition at line 897 of file solver_facade.cpp.
References line::api::ZeroCapacity::any(), line::SolverOptions::cache, cache_, fj_, line::qn::Network< T >::get_struct(), model_, name_, opts_, line::api::ZeroCapacity::reason, line::api::sn_zero_capacity(), solved_, table_, and line::UnsupportedError::UnsupportedError().
Referenced by avg_chain(), avg_fj(), avg_qlen_table(), avg_respt_table(), avg_sys_table(), avg_tput_table(), avg_util_table(), cache_metrics(), line::wfn::WorkflowNet::get_case_metrics(), line::SolverLDES::init_from_solver(), method_used(), and run_analyzer().
|
inline |
Definition at line 160 of file solver.h.
References avg_chain(), and line::AvgChain::TN.
|
inline |
getAvgTputTable(): avg_table()'s Station, JobClass and Tput columns.
Definition at line 145 of file solver.h.
References line::avg_metric_view(), and avg_table().
|
inline |
Definition at line 156 of file solver.h.
References avg_chain(), and line::AvgChain::UN.
|
inline |
getAvgUtilTable(): avg_table()'s Station, JobClass and Util columns.
Definition at line 141 of file solver.h.
References line::avg_metric_view(), and avg_table().
| 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 1127 of file solver_facade.cpp.
References avg_table(), and cache_.
Referenced by hit_ratio(), and miss_ratio().
|
inline |
Definition at line 203 of file solver.h.
References avg_fj_table().
|
inline |
getName(): the solver's own name, e.g.
"MVA".
Definition at line 128 of file solver.h.
References name_.
Referenced by line::SolverLDES::init_from_solver().
| std::vector< double > line::NetworkSolver::hit_ratio | ( | const Node & | cache | ) |
Definition at line 1183 of file solver_facade.cpp.
References hit_ratio().
| 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 1175 of file solver_facade.cpp.
References cache_metrics(), and name_.
Referenced by hit_ratio().
|
inline |
| std::vector< std::string > line::NetworkSolver::list_valid_methods | ( | ) | const |
listValidMethods(): the methods this solver advertises on this model.
Definition at line 1187 of file solver_facade.cpp.
References line::autosolver::auto_list_valid_methods(), line::fluid::fluid_list_valid_methods(), line::qn::Network< T >::get_struct(), line::jmt::jmt_list_valid_methods(), line::ba::list_valid_methods(), line::ctmc::list_valid_methods(), line::ldes::list_valid_methods(), line::mam::list_valid_methods(), line::mva::list_valid_methods(), line::nc::list_valid_methods(), line::ssa::list_valid_methods(), model_, name_, and line::UnsupportedError::UnsupportedError().
| std::string line::NetworkSolver::method_used | ( | ) |
getMethodUsed(): the method the solve actually resolved to.
Definition at line 933 of file solver_facade.cpp.
References avg_table(), and line::AvgTable::method.
| std::vector< double > line::NetworkSolver::miss_ratio | ( | const Node & | cache | ) |
Definition at line 1185 of file solver_facade.cpp.
References miss_ratio().
| std::vector< double > line::NetworkSolver::miss_ratio | ( | const std::string & | cache | ) |
cache.getMissRatio() after the solve, with hit_ratio's conventions.
Definition at line 1179 of file solver_facade.cpp.
References cache_metrics(), and name_.
Referenced by miss_ratio().
|
inline |
The model this solver was built on.
Definition at line 132 of file solver.h.
References model_.
Referenced by line::wfn::WorkflowNet::get_case_metrics(), and line::SolverAUTO::supports().
|
inline |
The options this solver was built with.
Definition at line 130 of file solver.h.
References opts_.
Referenced by line::SolverLDES::init_from_solver().
|
inline |
reset(): discard the cached solve.
Definition at line 170 of file solver.h.
References cache_, fj_, solved_, and table_.
Referenced by line::SolverLDES::init_from_jobs(), and line::SolverLDES::init_from_solver().
|
inline |
runAnalyzer(): force the solve, returning the table it produced.
Definition at line 164 of file solver.h.
References avg_table().
|
protected |
Definition at line 213 of file solver.h.
Referenced by avg_table(), cache_metrics(), and reset().
|
protected |
Definition at line 214 of file solver.h.
Referenced by avg_fj(), avg_table(), and reset().
|
protected |
Definition at line 209 of file solver.h.
Referenced by avg_chain(), avg_chain_table(), avg_fj_table(), avg_sys_table(), avg_table(), 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::init_from_solver(), list_valid_methods(), line::SolverCTMC::marg_aggr(), model(), line::SolverAUTO::nc_solver(), NetworkSolver(), line::SolverAUTO::prob_aggr(), line::SolverCTMC::prob_aggr(), line::SolverJMT::prob_aggr(), line::SolverAUTO::proposed_solver_names(), line::SolverJMT::sample(), 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().
|
protected |
Definition at line 210 of file solver.h.
Referenced by avg_table(), get_name(), hit_ratio(), list_valid_methods(), miss_ratio(), and NetworkSolver().
|
protected |
Definition at line 211 of file solver.h.
Referenced by 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::SolverAUTO::prob_aggr(), line::SolverCTMC::prob_aggr(), line::SolverJMT::prob_aggr(), line::SolverAUTO::proposed_solver_names(), line::SolverJMT::sample(), 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().
|
protected |
Definition at line 215 of file solver.h.
Referenced by avg_table(), is_solved(), line::SolverAUTO::is_stochastic(), reset(), and line::SolverAUTO::selected_solver_name().
|
protected |
Definition at line 212 of file solver.h.
Referenced by avg_table(), line::SolverAUTO::is_stochastic(), reset(), and line::SolverAUTO::selected_solver_name().