LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::tr Namespace Reference

Functions

template<class T>
bool has_fork_join (const qn::NetworkStruct< T > &sn)
 Whether the model needs the tag augmentation at all.
template<class T, class Avg>
void fj_foldback (const qn::NetworkStruct< T > &sn, Avg &a, const std::vector< std::size_t > &fjclassmap, std::size_t korig)
 Reduce the augmented metrics onto the original classes.
template<class T, class InnerSolve>
mva::AvgResult< T > transform_solve_chains (const qn::NetworkStruct< T > &sn, InnerSolve inner_solve, const std::string &method)
 Chain aggregation: collapse every chain onto a single class, solve, and map the chain metrics back onto the classes.
template<class T, class InnerSolve>
mva::AvgResult< T > transform_solve_lc (const qn::NetworkStruct< T > &sn, InnerSolve inner_solve, const std::string &method, std::size_t iter_max=1000)
 LOAD CONCEALMENT (Birman-Kogan Algorithm 2) as a transformation, and the first ITERATED one.

Function Documentation

◆ fj_foldback()

template<class T, class Avg>
void line::tr::fj_foldback ( const qn::NetworkStruct< T > & sn,
Avg & a,
const std::vector< std::size_t > & fjclassmap,
std::size_t korig )

Reduce the augmented metrics onto the original classes.

A sibling class is a PART of the class it was forked from, so its queue length, utilization and throughput are exact aggregates and simply add. Response time is NOT additive and is recomputed by Little's law afterwards. The SYSTEM metrics are truncated rather than summed: XN is the departure rate at the parent class's reference station, which no sibling visits, and adding a branch's throughput to it would count each forked task once per branch.

Template Parameters
Tthe struct's numeric type
Avgthe caller's result container, with QN, UN, TN, RN, CN, XN

Definition at line 84 of file fj_tag_transform.h.

References fj_foldback(), line::mva::sn_apply_join_respt(), and line::mva::sn_get_arvr_from_tput().

Referenced by fj_foldback(), line::ctmc::solver_ctmc_analyzer(), and line::ssa::solver_ssa_serial_analyzer().

◆ has_fork_join()

template<class T>
bool line::tr::has_fork_join ( const qn::NetworkStruct< T > & sn)

Whether the model needs the tag augmentation at all.

A Fork or a Join sends the model down the qn::fj_tag route; neither means it stays on the ordinary one. Four analyzers carried their own copy of this loop (CTMC steady-state and transient, SSA serial, the chain tables), which is the C++ share of the bookkeeping that MATLAB, the JAR and python absorbed into an expand phase.

There is deliberately NO expand here to match those three. qn::fj_tag ALREADY returns the context they had to build by hand: FjTagged carries the augmented struct, the sync list, fjclassmap and korig together, so wrapping it would add a layer without removing a duplication.

Definition at line 62 of file fj_tag_transform.h.

References has_fork_join(), and line::lang::Join.

Referenced by has_fork_join(), line::ctmc::solver_ctmc_analyzer(), line::ctmc::solver_ctmc_transient_analyzer(), and line::ssa::solver_ssa_serial_analyzer().

◆ transform_solve_chains()

template<class T, class InnerSolve>
mva::AvgResult< T > line::tr::transform_solve_chains ( const qn::NetworkStruct< T > & sn,
InnerSolve inner_solve,
const std::string & method )

Chain aggregation: collapse every chain onto a single class, solve, and map the chain metrics back onto the classes.

api::sn_aggregate_chains builds the collapsed model and mva::sn_deaggregate_chain_results maps its metrics back through alpha, the per-station share of the chain's visits each class carries.

WHAT IS TRADED. Exactness on a non-product-form model: one aggregate service law, fitted to the alpha-weighted first two moments, replaces the per-class ones. On a product-form model the chain IS the unit MVA and convolution already solve in, so the answer is exact and the state space is the smaller one.

SINGLE PASS: one solve of the aggregate determines the answer, so there is no sweep and no convergence test.

Parameters
snthe original struct
inner_solvesolves the aggregated struct, normally with the caller's own analyzer bound to its own options
methodthe caller's method name, for the reported compound name

Definition at line 82 of file transform_solve.h.

References line::mva::AvgResult< T >::actualmethod, line::mva::AvgResult< T >::AN, line::mva::ClassResults< T >::C, line::mva::AvgResult< T >::CN, line::mva::AvgResult< T >::method, line::api::ChainAggregationResult< T >::model, line::mva::ClassResults< T >::Q, line::mva::AvgResult< T >::QN, line::mva::ClassResults< T >::R, line::mva::AvgResult< T >::RN, line::api::sn_aggregate_chains(), line::mva::sn_deaggregate_chain_results(), line::mva::sn_get_arvr_from_tput(), line::mva::sn_get_demands_chain(), line::mva::sn_get_residt_from_respt(), line::mva::AvgResult< T >::TN, line::mva::ClassResults< T >::Tp, transform_solve_chains(), line::mva::ClassResults< T >::U, line::mva::AvgResult< T >::UN, line::mva::AvgResult< T >::WN, line::mva::ClassResults< T >::X, and line::mva::AvgResult< T >::XN.

Referenced by line::ctmc::solver_ctmc_chain_aggregation(), and transform_solve_chains().

◆ transform_solve_lc()

template<class T, class InnerSolve>
mva::AvgResult< T > line::tr::transform_solve_lc ( const qn::NetworkStruct< T > & sn,
InnerSolve inner_solve,
const std::string & method,
std::size_t iter_max = 1000 )

LOAD CONCEALMENT (Birman-Kogan Algorithm 2) as a transformation, and the first ITERATED one.

Chain l is solved on its own against the residual capacity the others leave it, A_i = 1 - sum_{k!=l} L(i,k) X_k, so it sees the concealed demand L(i,l)/A_i. Sweeping the chains in GAUSS-SEIDEL order – publishing each chain's throughput the moment it is known, so chain l+1 of the same sweep already sees it – and iterating to a fixed point is the algorithm.

WHAT THIS ADDS OVER THE KERNEL. pfqn_bklc solves each single-chain subproblem on a DEMAND VECTOR with the inner solve hard-wired to MVA or the uniform expansion. Here the subproblem is a real single-class struct, so the inner solve is whichever analyzer the caller bound, which is what makes the concealment approximation measurable rather than merely asserted.

IT IS NOT A STRICTLY BETTER LC: the kernel sees only L, while the chain aggregation refits the chain service law to two moments.

THE TOLERANCE IS FIXED AT 1e-10, a PARITY requirement and not a knob: a looser one stops the sweep at a different iteration in each codebase.

Mirrors MATLAB solver_tr_lc_analyzer.m, python _lc_strategy and the JAR jline.solvers.tr.LcStrategy.

Parameters
snthe original struct
inner_solvesolves one concealed single-class struct
methodthe caller's method name, for the reported compound name
iter_maxsweep cap; the kernel's own default is 1000

Definition at line 144 of file transform_solve.h.

References line::mva::AvgResult< T >::actualmethod, line::mva::AvgResult< T >::AN, line::mva::ClassResults< T >::C, line::mva::AvgResult< T >::CN, line::lang::dist_scale_rate(), line::InputError::InputError(), line::mva::AvgResult< T >::iter, line::mva::ChainDemands< T >::Lchain, line::mva::AvgResult< T >::method, line::api::ChainAggregationResult< T >::model, line::mva::ChainDemands< T >::Nchain, line::qn::NetworkStruct< T >::nclasses, line::qn::NetworkStruct< T >::nstations, line::pfqn::pfqn_bk(), line::mva::ClassResults< T >::Q, line::mva::AvgResult< T >::QN, line::mva::ClassResults< T >::R, line::mva::AvgResult< T >::RN, line::qn::NetworkStruct< T >::service, line::api::sn_aggregate_chains(), line::mva::sn_deaggregate_chain_results(), line::mva::sn_get_arvr_from_tput(), line::mva::sn_get_demands_chain(), line::mva::sn_get_residt_from_respt(), line::api::sn_remove_class(), line::qn::NetworkStruct< T >::stations, line::mva::AvgResult< T >::TN, line::mva::ClassResults< T >::Tp, transform_solve_lc(), line::mva::ClassResults< T >::U, line::mva::AvgResult< T >::UN, line::mva::AvgResult< T >::WN, line::mva::ClassResults< T >::X, line::pfqn::BkResult< T >::X, and line::mva::AvgResult< T >::XN.

Referenced by line::ctmc::solver_ctmc_load_concealment(), and transform_solve_lc().