LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::ln::SolverLN< T > Class Template Reference

#include <line/solvers/ln/solver_ln.h>

Public Member Functions

 SolverLN (const LqnStruct< T > &lqn_in, const LnOptions &options)
LnSolution< T > get_ensemble_avg ()
 Port of getEnsembleAvg: run the iteration and aggregate onto LQN elements.
std::vector< LnCdf > get_cdf_respt ()
 Port of @SolverLN/getCdfRespT: the per-entry response-time distribution.
LnTranSolution get_tran_avg ()
 Port of @SolverLN/getTranAvg: the block-diagonal aggregate transient.
LnSensTable< T > get_sensitivity_table (const sens::SensOptions &sopt)
 Port of @SolverLN/getSensitivityTable: solve the ensemble, then concatenate each layer solver's own table under a leading Layer column.
LnSolution< T > box_bounds ()
 Majumdar-Woodside robust box bounds, reported in the shape of a solution.
std::size_t nlayers () const
const std::vector< qn::Layer< T > > & layers () const
LnLayerBlocks layer_blocks () const
 Port of LayeredNetwork.layerBlocks: the block-diagonal layout of the layers in the aggregate (station x class) view.
void init_from_marginal (const Matrix< double > &n)
 Port of LayeredNetwork.initFromMarginal: split an aggregate (M x K) mean queue-length matrix into per-layer blocks and warm-start each layer from its own.
void set_tran_grid (const std::vector< double > &g)
 Install the explicit output grid of the layered transient; see LnOptions::tran_grid.
const std::vector< std::vector< LayerResult< T > > > & iteration_results () const
 Diagnostic access to the per-iteration layer results, for the regression.
const std::vector< T > & state_servt () const
const std::vector< T > & state_residt () const
const std::vector< T > & state_tput () const
const std::vector< T > & state_thinkt () const
const std::vector< T > & state_callservt () const
const std::vector< T > & state_callresidt () const
const std::vector< Distrib< T > > & state_servtproc () const
const std::vector< Distrib< T > > & state_thinktproc () const
const std::vector< Distrib< T > > & state_callservtproc () const
const std::vector< T > & state_util () const
const std::string & state_lnmethod () const
 The method the layers were built for: "srvn.ph", "srvn.cs" or "moment3".
const std::string & state_interlock_method () const
 The interlock tracking method this run USES: "ilrate", "refpath" or "none".
const std::vector< double > & state_refpath_stages () const
 Per reference-path stage key, the stage mean the last iteration installed.
LnInterlockChoice interlock_method_for () const
 Port of SolverLN.interlockMethodFor: the method a solve would use, asked through the same query build_layers asks.

Static Public Member Functions

static std::vector< std::string > list_valid_methods ()
 Port of SolverLN.listValidMethods.

Detailed Description

template<class T>
class line::ln::SolverLN< T >

Definition at line 492 of file solver_ln.h.

Constructor & Destructor Documentation

◆ SolverLN()

template<class T>
line::ln::SolverLN< T >::SolverLN ( const LqnStruct< T > & lqn_in,
const LnOptions & options )
inline

Definition at line 506 of file solver_ln.h.

Member Function Documentation

◆ box_bounds()

template<class T>
LnSolution< T > line::ln::SolverLN< T >::box_bounds ( )
inline

Majumdar-Woodside robust box bounds, reported in the shape of a solution.

mw.upper reports the upper bound of both throughput and processor utilization, mw.lower the lower bound of both. Everything the bound does not define – queue length, response time, residence time, arrival rate – is left UNDEFINED rather than zeroed.

Definition at line 655 of file solver_ln.h.

References line::ln::LnSolution< T >::AN, line::ln::LnSolution< T >::converged, line::ln::LnSolution< T >::defined_A, line::ln::LnSolution< T >::defined_Q, line::ln::LnSolution< T >::defined_R, line::ln::LnSolution< T >::defined_T, line::ln::LnSolution< T >::defined_U, line::ln::LnSolution< T >::defined_W, line::ln::LnSolution< T >::is_bound, line::ln::LnSolution< T >::iterations, line::lqn::lqn_boxbounds(), line::ln::LnSolution< T >::QN, line::ln::LnSolution< T >::RN, line::ln::LnSolution< T >::TN, line::ln::LnSolution< T >::UN, and line::ln::LnSolution< T >::WN.

Referenced by get_ensemble_avg().

◆ get_cdf_respt()

template<class T>
std::vector< LnCdf > line::ln::SolverLN< T >::get_cdf_respt ( )
inline

Port of @SolverLN/getCdfRespT: the per-entry response-time distribution.

ONLY THE moment3 METHOD PRODUCES ONE. The reference reacts to an empty table by re-running getAvg under method='moment3' and restoring the caller's method afterwards, and so does this: the distribution is the whole point of that method, and the mean-based update has no distribution to report, not a coarser one.

Indexed by entry NUMBER 1..nentries, as the reference's entrycdfrespt{eidx - (nhosts+ntasks)} is.

Definition at line 552 of file solver_ln.h.

References line::UnsupportedError::UnsupportedError().

Referenced by line::ln::lqn_cdf_respt().

◆ get_ensemble_avg()

template<class T>
LnSolution< T > line::ln::SolverLN< T >::get_ensemble_avg ( )
inline

Port of getEnsembleAvg: run the iteration and aggregate onto LQN elements.

Definition at line 528 of file solver_ln.h.

References box_bounds().

◆ get_sensitivity_table()

template<class T>
LnSensTable< T > line::ln::SolverLN< T >::get_sensitivity_table ( const sens::SensOptions & sopt)
inline

Port of @SolverLN/getSensitivityTable: solve the ensemble, then concatenate each layer solver's own table under a leading Layer column.

WHAT THESE DERIVATIVES MEAN, and the reference is emphatic about it: each entry is a partial derivative WITHIN ITS LAYER, taken with the layer parameters the fixed point produced held fixed. Perturbing a host demand moves the think times, populations and demands of every other layer through the fixed-point map, and that indirect term is NOT included. The table attributes a bottleneck inside a layer; it does not predict the effect of a parameter change on the solved layered model.

Definition at line 610 of file solver_ln.h.

References line::sens::SensRow< T >::dQLen, line::sens::SensRow< T >::dRespT, line::sens::SensRow< T >::dTput, line::sens::SensRow< T >::dUtil, line::sens::SensRow< T >::jobclass, line::ln::LnSensTable< T >::layer_methods, line::ln::LnSensTable< T >::layer_tables, line::ln::LnSensTable< T >::method, line::sens::SensTable< T >::method, line::ln::LnSensTable< T >::rows, line::sens::SensTable< T >::rows, line::sens::SensOptions::simulation, line::sens::solver_sensitivity_table(), and line::sens::SensRow< T >::station.

Referenced by line::opt::LineEvaluator::evaluate_layered_sensitivities(), and line::ln::lqn_sensitivity_table().

◆ get_tran_avg()

template<class T>
LnTranSolution line::ln::SolverLN< T >::get_tran_avg ( )
inline

Port of @SolverLN/getTranAvg: the block-diagonal aggregate transient.

opt.ln_transient selects the coupling; both modes return the same layout, and iteration 0 of the coupled relaxation IS the decoupled answer.

Definition at line 591 of file solver_ln.h.

References line::InputError::InputError().

Referenced by line::ln::lqn_tran_avg().

◆ init_from_marginal()

template<class T>
void line::ln::SolverLN< T >::init_from_marginal ( const Matrix< double > & n)
inline

Port of LayeredNetwork.initFromMarginal: split an aggregate (M x K) mean queue-length matrix into per-layer blocks and warm-start each layer from its own.

WHY THIS IS RECORDED AND NOT APPLIED HERE, which is the trap the JAR and python ports both hit: the layered fixed point RESETS its layers as it converges, so a warm start installed before the solve does not survive it. The blocks are therefore kept and replayed by run_layer_transient, i.e. after the fixed point and immediately before each layer's transient – the steady solve ignores an initial state, the transient does not.

THE BLOCK IS NOT ROUNDED. The reference rounds a replayed block onto the integer lattice for every layer engine EXCEPT the fluid one, and the layered transient exists only over fluid layers (require_transient_ready refuses the rest), so the branch that would round has no reachable case here. Rounding a fluid state would quantize the very quantity SolverENV's fixed point is iterating on.

An empty matrix clears the warm start, so a caller can put the layers back on their default initial state without rebuilding the solver.

Definition at line 739 of file solver_ln.h.

References line::ln::LnLayerBlocks::coff, line::Matrix< T >::cols(), line::Matrix< T >::empty(), line::fluid::FluidLayout::enabled, line::fluid::fluid_layout(), line::InputError::InputError(), line::ln::LnLayerBlocks::K, line::ln::LnLayerBlocks::ksz, layer_blocks(), line::ln::LnLayerBlocks::M, line::ln::LnLayerBlocks::msz, line::qn::NetworkStruct< T >::nclasses, line::fluid::FluidLayout::nstates, line::qn::NetworkStruct< T >::nstations, line::fluid::FluidLayout::qidx, line::ln::LnLayerBlocks::roff, and line::Matrix< T >::rows().

◆ interlock_method_for()

template<class T>
LnInterlockChoice line::ln::SolverLN< T >::interlock_method_for ( ) const
inline

Port of SolverLN.interlockMethodFor: the method a solve would use, asked through the same query build_layers asks.

Like the reference it does not see the construct-time demotion of a refpath that merged nothing; that recorded answer is state_interlock_method().

Definition at line 802 of file solver_ln.h.

References line::ln::ln_interlock_method().

◆ iteration_results()

template<class T>
const std::vector< std::vector< LayerResult< T > > > & line::ln::SolverLN< T >::iteration_results ( ) const
inline

Diagnostic access to the per-iteration layer results, for the regression.

Definition at line 774 of file solver_ln.h.

◆ layer_blocks()

template<class T>
LnLayerBlocks line::ln::SolverLN< T >::layer_blocks ( ) const
inline

Port of LayeredNetwork.layerBlocks: the block-diagonal layout of the layers in the aggregate (station x class) view.

Available as soon as the solver is constructed – build_layers runs in the constructor – which is what lets SolverENV compare the shapes of its stages before solving any of them.

Definition at line 699 of file solver_ln.h.

References line::ln::LnLayerBlocks::coff, line::ln::LnLayerBlocks::K, line::ln::LnLayerBlocks::ksz, line::ln::LnLayerBlocks::M, line::ln::LnLayerBlocks::msz, and line::ln::LnLayerBlocks::roff.

Referenced by init_from_marginal().

◆ layers()

template<class T>
const std::vector< qn::Layer< T > > & line::ln::SolverLN< T >::layers ( ) const
inline

Definition at line 689 of file solver_ln.h.

◆ list_valid_methods()

template<class T>
std::vector< std::string > line::ln::SolverLN< T >::list_valid_methods ( )
inlinestatic

Port of SolverLN.listValidMethods.

Each name states the LAYERING and the ENCODING; ln_requested_method normalises the alias spellings ("ph", "cs", "srvncs", "flatcs", "squashed", "squashed.ph") onto these, and they are left out here to keep the list unambiguous, exactly as the reference does.

Definition at line 502 of file solver_ln.h.

◆ nlayers()

template<class T>
std::size_t line::ln::SolverLN< T >::nlayers ( ) const
inline

Definition at line 688 of file solver_ln.h.

◆ set_tran_grid()

template<class T>
void line::ln::SolverLN< T >::set_tran_grid ( const std::vector< double > & g)
inline

Install the explicit output grid of the layered transient; see LnOptions::tran_grid.

Definition at line 771 of file solver_ln.h.

◆ state_callresidt()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_callresidt ( ) const
inline

Definition at line 780 of file solver_ln.h.

◆ state_callservt()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_callservt ( ) const
inline

Definition at line 779 of file solver_ln.h.

◆ state_callservtproc()

template<class T>
const std::vector< Distrib< T > > & line::ln::SolverLN< T >::state_callservtproc ( ) const
inline

Definition at line 783 of file solver_ln.h.

◆ state_interlock_method()

template<class T>
const std::string & line::ln::SolverLN< T >::state_interlock_method ( ) const
inline

The interlock tracking method this run USES: "ilrate", "refpath" or "none".

Recorded by build_layers and, when no layer merged a reference chain, demoted from "refpath" to "ilrate" at the end of construct.

Definition at line 792 of file solver_ln.h.

◆ state_lnmethod()

template<class T>
const std::string & line::ln::SolverLN< T >::state_lnmethod ( ) const
inline

The method the layers were built for: "srvn.ph", "srvn.cs" or "moment3".

Definition at line 786 of file solver_ln.h.

◆ state_refpath_stages()

template<class T>
const std::vector< double > & line::ln::SolverLN< T >::state_refpath_stages ( ) const
inline

Per reference-path stage key, the stage mean the last iteration installed.

Definition at line 794 of file solver_ln.h.

◆ state_residt()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_residt ( ) const
inline

Definition at line 776 of file solver_ln.h.

◆ state_servt()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_servt ( ) const
inline

Definition at line 775 of file solver_ln.h.

◆ state_servtproc()

template<class T>
const std::vector< Distrib< T > > & line::ln::SolverLN< T >::state_servtproc ( ) const
inline

Definition at line 781 of file solver_ln.h.

◆ state_thinkt()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_thinkt ( ) const
inline

Definition at line 778 of file solver_ln.h.

◆ state_thinktproc()

template<class T>
const std::vector< Distrib< T > > & line::ln::SolverLN< T >::state_thinktproc ( ) const
inline

Definition at line 782 of file solver_ln.h.

◆ state_tput()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_tput ( ) const
inline

Definition at line 777 of file solver_ln.h.

◆ state_util()

template<class T>
const std::vector< T > & line::ln::SolverLN< T >::state_util ( ) const
inline

Definition at line 784 of file solver_ln.h.


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