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.
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

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 123 of file solver.h.

Constructor & Destructor Documentation

◆ ~NetworkSolver()

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

Definition at line 125 of file solver.h.

◆ NetworkSolver()

Member Function Documentation

◆ avg_arvr_chain()

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

Definition at line 159 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 1132 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 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().

◆ avg_fjt()

AvgFJTable line::NetworkSolver::avg_fjt ( )
inline

Definition at line 202 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 155 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 139 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 158 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 157 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 143 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 148 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 150 of file solver.h.

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

◆ avg_table()

◆ avg_tput_chain()

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

Definition at line 160 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 145 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 156 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 141 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 1127 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 203 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 128 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 1183 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 1175 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 168 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 933 of file solver_facade.cpp.

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

◆ miss_ratio() [1/2]

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

Definition at line 1185 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 1179 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 132 of file solver.h.

References model_.

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

◆ options()

const SolverOptions & line::NetworkSolver::options ( ) const
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().

◆ reset()

void line::NetworkSolver::reset ( )
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().

◆ run_analyzer()

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

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

Definition at line 164 of file solver.h.

References avg_table().

Member Data Documentation

◆ cache_

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

Definition at line 213 of file solver.h.

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

◆ fj_

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

Definition at line 214 of file solver.h.

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

◆ model_

◆ name_

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

Definition at line 210 of file solver.h.

Referenced by avg_table(), get_name(), hit_ratio(), list_valid_methods(), miss_ratio(), and NetworkSolver().

◆ opts_

◆ solved_

bool line::NetworkSolver::solved_ = false
protected

◆ table_

AvgTable line::NetworkSolver::table_
protected

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