![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | CacheMetrics |
| Every Cache node of the model, in node order; empty on a model with none. More... | |
| struct | CacheNodeMetrics |
| One Cache node's measured behaviour. More... | |
| struct | ChainResult |
| The station- or node-level table aggregated by chain. More... | |
| struct | DefaultCdfCurve |
| One [F(t), t] curve of the base-class response-time CDF fallback. More... | |
| struct | NodeMetrics |
| The station table scattered to the NODE index space, plus the two flow columns the reference recomputes there. More... | |
| struct | SysResult |
| @@NetworkSolver/getAvgSys: one response time and one throughput per chain. More... | |
Functions | |
| template<class T> | |
| CacheMetrics< T > | cache_metrics_of (const qn::NetworkStruct< T > &sn, const std::vector< T > &hitprob, const std::vector< T > &missprob, const std::vector< T > &delayedprob, const std::vector< T > &latency, const Matrix< T > &hitproblist, const Matrix< T > &itemprob, const std::vector< T > &listcost) |
| Assemble CacheMetrics from what a cache analyzer returned. | |
| template<class T> | |
| CacheMetrics< T > | cache_metrics_of_matrix (const qn::NetworkStruct< T > &sn, const Matrix< T > &hitprob, const Matrix< T > &missprob) |
| The same, for the integrated caching-queueing branch, whose hit and miss probabilities are (ncaches x nclasses) rather than one vector per model. | |
| template<class T> | |
| SysResult< T > | solver_get_avg_sys (const qn::NetworkStruct< T > &sn, const mva::AvgResult< T > &r) |
| Port of @@NetworkSolver/getAvgSys.m. | |
| template<class T> | |
| ChainResult< T > | solver_get_avg_chain (const qn::NetworkStruct< T > &sn, const mva::AvgResult< T > &r) |
| Port of @@NetworkSolver/getAvgChain.m: the station table aggregated by chain. | |
| template<class T> | |
| ChainResult< T > | solver_get_avg_node_chain (const qn::NetworkStruct< T > &sn, const Matrix< T > &QNn, const Matrix< T > &UNn, const Matrix< T > &RNn, const Matrix< T > &WNn, const Matrix< T > &ANn, const Matrix< T > &TNn) |
| Port of @@NetworkSolver/getAvgNodeChain.m: the NODE table aggregated by chain. | |
| std::vector< std::string > | chain_names (std::size_t nchains) |
| Chain1, Chain2, ... – the reference's own chain labels. | |
| template<class T> | |
| std::vector< std::string > | chain_class_labels (const qn::NetworkStruct< T > &sn) |
| (ClassA ClassB), the JobClasses column: which classes a chain holds. | |
| template<class T> | |
| std::vector< std::vector< DefaultCdfCurve > > | solver_default_cdf_respt (const qn::NetworkStruct< T > &sn, const Matrix< T > &RN) |
| The NetworkSolver base-class response-time CDF: an exponential law with the right mean per (station, class), tabulated on 100 quantile points. | |
| template<class T> | |
| line::mva::AvgResult< T > | avg_result_from_sim (const line::qn::NetworkStruct< T > &sn, const line::Matrix< double > &QN, const line::Matrix< double > &UN, const line::Matrix< double > &RN, const line::Matrix< double > &TN, const std::vector< double > &CN, const std::vector< double > &XN, const std::string &method) |
| The station AvgResult of a solver whose runner returns its own solution type, i.e. | |
| template<class T> | |
| NodeMetrics< T > | node_metrics (const line::qn::NetworkStruct< T > &sn, const line::mva::AvgResult< T > &r) |
| line::mva::AvgResult< T > line::solvers::avg_result_from_sim | ( | const line::qn::NetworkStruct< T > & | sn, |
| const line::Matrix< double > & | QN, | ||
| const line::Matrix< double > & | UN, | ||
| const line::Matrix< double > & | RN, | ||
| const line::Matrix< double > & | TN, | ||
| const std::vector< double > & | CN, | ||
| const std::vector< double > & | XN, | ||
| const std::string & | method ) |
The station AvgResult of a solver whose runner returns its own solution type, i.e.
SSA and Fluid: their QN/UN/RN/TN are the same six columns the AvgTable arm already prints, so a VIEW of them is a view of the same numbers.
The two columns those runners do not carry are filled the way the reference fills them, and the SAME way their own -a avg arms do:
Definition at line 63 of file solver_node_tables.h.
References line::mva::AvgResult< T >::actualmethod, line::mva::AvgResult< T >::AN, line::mva::ArvR, avg_result_from_sim(), line::mva::AvgResult< T >::CN, line::lang::EXT, line::mva::filter_metric(), line::mva::AvgResult< T >::method, line::mva::AvgResult< T >::QN, line::mva::AvgResult< T >::RN, line::mva::sn_get_arvr_from_tput(), line::mva::sn_get_residt_from_respt(), line::mva::AvgResult< T >::TN, line::mva::AvgResult< T >::UN, line::mva::AvgResult< T >::WN, and line::mva::AvgResult< T >::XN.
Referenced by avg_result_from_sim().
| CacheMetrics< T > line::solvers::cache_metrics_of | ( | const qn::NetworkStruct< T > & | sn, |
| const std::vector< T > & | hitprob, | ||
| const std::vector< T > & | missprob, | ||
| const std::vector< T > & | delayedprob, | ||
| const std::vector< T > & | latency, | ||
| const Matrix< T > & | hitproblist, | ||
| const Matrix< T > & | itemprob, | ||
| const std::vector< T > & | listcost ) |
Assemble CacheMetrics from what a cache analyzer returned.
ONE PLACE, EVERY BRANCH OF EVERY SOLVER. Each cache analyzer computes a different subset – the retrieval ones give a delayed-hit fraction, the non-reentrant one gives the per-item law, the integrated one gives neither – and each leaves the rest empty. Assembling the struct here rather than in each branch keeps "absent means not computed" a single rule, which is what lets getAvgCacheTable print NaN in exactly the right places.
IT LIVES HERE, BESIDE THE STRUCT IT BUILDS, rather than in a solver's runner: SolverNC and SolverMVA both have cache branches and must assemble the answer the same way, and a runner including another runner to borrow the helper is how the two would drift apart.
THE MODEL'S CACHES ARE READ FROM THE STRUCT, not from the analyzer: the caps, the item count and the item sizes are model parameters and are reported even where the solve measured nothing, so a caller can see the cache it described.
Definition at line 105 of file cache_metrics.h.
References cache_metrics_of(), line::solvers::CacheMetrics< T >::caches, line::Matrix< T >::cols(), line::solvers::CacheNodeMetrics< T >::delayedprob, line::solvers::CacheNodeMetrics< T >::hitprob, line::solvers::CacheNodeMetrics< T >::hitproblist, line::solvers::CacheNodeMetrics< T >::itemcap, line::solvers::CacheNodeMetrics< T >::itemprob, line::solvers::CacheNodeMetrics< T >::itemsize, line::solvers::CacheNodeMetrics< T >::latency, line::solvers::CacheNodeMetrics< T >::listcost, line::solvers::CacheNodeMetrics< T >::missprob, line::solvers::CacheNodeMetrics< T >::name, line::solvers::CacheNodeMetrics< T >::nitems, line::solvers::CacheNodeMetrics< T >::node, and line::Matrix< T >::rows().
Referenced by cache_metrics_of(), cache_metrics_of_matrix(), line::ssa::cache_metrics_of_ssa(), and line::mva::mva_dispatch().
| CacheMetrics< T > line::solvers::cache_metrics_of_matrix | ( | const qn::NetworkStruct< T > & | sn, |
| const Matrix< T > & | hitprob, | ||
| const Matrix< T > & | missprob ) |
The same, for the integrated caching-queueing branch, whose hit and miss probabilities are (ncaches x nclasses) rather than one vector per model.
Definition at line 163 of file cache_metrics.h.
References cache_metrics_of(), cache_metrics_of_matrix(), line::solvers::CacheMetrics< T >::caches, line::Matrix< T >::cols(), and line::Matrix< T >::rows().
Referenced by cache_metrics_of_matrix(), line::mva::mva_dispatch(), and line::fluid::solver_fluid_run_analyzer().
| std::vector< std::string > line::solvers::chain_class_labels | ( | const qn::NetworkStruct< T > & | sn | ) |
(ClassA ClassB), the JobClasses column: which classes a chain holds.
Definition at line 548 of file solver_chain_tables.h.
References chain_class_labels().
Referenced by chain_class_labels().
|
inline |
Chain1, Chain2, ... – the reference's own chain labels.
Definition at line 540 of file solver_chain_tables.h.
References chain_names().
Referenced by chain_names().
| NodeMetrics< T > line::solvers::node_metrics | ( | const line::qn::NetworkStruct< T > & | sn, |
| const line::mva::AvgResult< T > & | r ) |
Definition at line 125 of file solver_node_tables.h.
References line::mva::AvgResult< T >::AN, line::solvers::NodeMetrics< T >::AN, line::mva::AvgResult< T >::cache, line::api::CacheActualProb< T >::delayed_hit, line::solvers::CacheNodeMetrics< T >::delayedprob, line::api::CacheActualProb< T >::hit, line::solvers::CacheNodeMetrics< T >::hitprob, line::api::CacheActualProb< T >::miss, line::solvers::CacheNodeMetrics< T >::missprob, line::solvers::CacheNodeMetrics< T >::node, node_metrics(), line::qn::NetworkStruct< T >::nodeparam, line::qn::NetworkStruct< T >::nodes, line::mva::AvgResult< T >::QN, line::solvers::NodeMetrics< T >::QN, line::mva::AvgResult< T >::refreshed_struct, line::mva::AvgResult< T >::RN, line::solvers::NodeMetrics< T >::RN, line::api::sn_get_node_arvr_from_tput(), line::api::sn_get_node_tput_from_tput(), line::mva::AvgResult< T >::TN, line::solvers::NodeMetrics< T >::TN, line::mva::AvgResult< T >::UN, line::solvers::NodeMetrics< T >::UN, line::mva::AvgResult< T >::WN, and line::solvers::NodeMetrics< T >::WN.
Referenced by node_metrics().
| std::vector< std::vector< DefaultCdfCurve > > line::solvers::solver_default_cdf_respt | ( | const qn::NetworkStruct< T > & | sn, |
| const Matrix< T > & | RN ) |
The NetworkSolver base-class response-time CDF: an exponential law with the right mean per (station, class), tabulated on 100 quantile points.
This is @@NetworkSolver/getCdfRespT.m verbatim – "a trivial approximation that assumes exponential distributions everywhere with mean as RN(i,r)" – and it is what the reference serves for every solver without a distributional result of its own (MVA, QNS, BA, AG). It says nothing about the tail; the solvers with a real law (CTMC, NC, Fluid, MAM, JMT, LDES) never reach it, and SSA refuses instead of inheriting it.
A Source station is left with empty curves, as the reference leaves its cells empty; a served cell whose mean is non-finite or non-positive gets the reference's degenerate [1, 0] point mass at zero.
Definition at line 50 of file solver_default_cdf.h.
References line::Matrix< T >::cols(), line::solvers::DefaultCdfCurve::F, line::Matrix< T >::rows(), solver_default_cdf_respt(), line::lang::Source, and line::solvers::DefaultCdfCurve::t.
Referenced by solver_default_cdf_respt().
| ChainResult< T > line::solvers::solver_get_avg_chain | ( | const qn::NetworkStruct< T > & | sn, |
| const mva::AvgResult< T > & | r ) |
Port of @@NetworkSolver/getAvgChain.m: the station table aggregated by chain.
QLen, Util, ArvR, Tput and ResidT are row sums over the chain's classes; RespT is the alpha-weighted average, alpha being sn_get_demands_chain's visit share. See the file header for why the two rules differ.
Definition at line 460 of file solver_chain_tables.h.
References line::mva::ChainDemands< T >::alpha, line::mva::AvgResult< T >::AN, line::solvers::ChainResult< T >::AN, line::Matrix< T >::Matrix(), line::mva::AvgResult< T >::QN, line::solvers::ChainResult< T >::QN, line::mva::AvgResult< T >::RN, line::solvers::ChainResult< T >::RN, line::mva::sn_get_demands_chain(), solver_get_avg_chain(), line::mva::AvgResult< T >::TN, line::solvers::ChainResult< T >::TN, line::mva::AvgResult< T >::UN, line::solvers::ChainResult< T >::UN, line::mva::AvgResult< T >::WN, and line::solvers::ChainResult< T >::WN.
Referenced by solver_get_avg_chain().
| ChainResult< T > line::solvers::solver_get_avg_node_chain | ( | const qn::NetworkStruct< T > & | sn, |
| const Matrix< T > & | QNn, | ||
| const Matrix< T > & | UNn, | ||
| const Matrix< T > & | RNn, | ||
| const Matrix< T > & | WNn, | ||
| const Matrix< T > & | ANn, | ||
| const Matrix< T > & | TNn ) |
Port of @@NetworkSolver/getAvgNodeChain.m: the NODE table aggregated by chain.
The node-level class matrices are the caller's, because the scatter from stations to nodes and the recomputation of ArvR and Tput per node is getAvgNodeTable's work and is not repeated here. Rows that are not stations carry zero response and residence time, which is the reference's construction and not a gap: a node that is not a station holds no jobs.
Definition at line 499 of file solver_chain_tables.h.
References line::mva::ChainDemands< T >::alpha, line::solvers::ChainResult< T >::AN, line::Matrix< T >::Matrix(), line::solvers::ChainResult< T >::QN, line::solvers::ChainResult< T >::RN, line::mva::sn_get_demands_chain(), solver_get_avg_node_chain(), line::solvers::ChainResult< T >::TN, line::solvers::ChainResult< T >::UN, and line::solvers::ChainResult< T >::WN.
Referenced by solver_get_avg_node_chain().
| SysResult< T > line::solvers::solver_get_avg_sys | ( | const qn::NetworkStruct< T > & | sn, |
| const mva::AvgResult< T > & | r ) |
Port of @@NetworkSolver/getAvgSys.m.
FORK-JOIN WITH AN OPEN CHAIN IS SERVED (2026-08-15). The reference fills the join station's response time with the order statistic of the parallel branch times – d0, an inclusion-exclusion sum over every path from the fork to the join, enumerated by ModelAdapter.pathsCS – and both halves of that are ported above as chain_detail::paths_cs and chain_detail::exp_max_mean. A CLOSED fork-join chain needs neither: its cycle time comes from Little's law, which reads the population and the throughput and never touches the join's response time, and the reference skips the walk there too. The JAR still refuses this case and then fills RN with NaN.
Definition at line 256 of file solver_chain_tables.h.
References line::solvers::SysResult< T >::CN, line::lang::Fork, line::lang::Join, line::mva::AvgResult< T >::RN, solver_get_avg_sys(), line::mva::AvgResult< T >::TN, line::UnsupportedError::UnsupportedError(), and line::solvers::SysResult< T >::XN.
Referenced by solver_get_avg_sys().