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

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

mwba.upper reports the upper bound of both throughput and processor utilization, mwba.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 627 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 524 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 500 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 582 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 563 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 711 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().

◆ 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 746 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 671 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 661 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 482 of file solver_ln.h.

◆ nlayers()

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

Definition at line 660 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 743 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 752 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 751 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 755 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 758 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 748 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 747 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 753 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 750 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 754 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 749 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 756 of file solver_ln.h.


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