![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | FesAggregateResult |
| What fes_aggregate returns. More... | |
| struct | FesConditionalMetrics |
| The per-population tables the conditional sum is taken over. More... | |
| struct | FesDeaggInfo |
| Everything needed to map an FES result back onto the original model. More... | |
| struct | FesIsolated |
| Demands and visit ratios of the isolated subnetwork. More... | |
| struct | FesMapAggregateResult |
| The load-dependent MAP that replaces a subnetwork, with its descriptors. More... | |
| struct | FesMapDeaggregateResult |
| Per-station metrics an aggregate stands for. More... | |
| struct | FesMapMoments |
| Descriptors a MAP(2) is fitted against. More... | |
| struct | FesMapSolveResult |
| System metrics of the delay plus flow-equivalent server model. More... | |
| struct | FesOptions |
| options of the reference; the solver field is implied by the convolution. More... | |
| struct | FesValidateResult |
| The reference's (isValid, errorMsg) pair. More... | |
Typedefs | |
| template<class T> | |
| using | FesBetaFun = std::function<std::vector<T>(const std::vector<int>&)> |
| Class-dependence handle: population vector -> per-class beta. | |
| template<class T> | |
| using | CdScaling |
| A class-dependent scaling map, sn.cdscaling. | |
Enumerations | |
| enum class | SchedStrategy |
| Scheduling disciplines, with the values of MATLAB SchedStrategy. More... | |
Functions | |
| template<class T> | |
| FesAggregateResult< T > | fes_aggregate (const qn::NetworkStruct< T > &sn, const std::vector< std::size_t > &subsetIndices, const FesOptions &options=FesOptions()) |
| Flow-equivalent-server aggregation: replace a station subset by one station. | |
| template<class T> | |
| FesBetaFun< T > | fes_beta_handle (const std::vector< std::vector< T > > &scalingTable, const std::vector< int > &cutoffs) |
| Wraps a flow-equivalent-server throughput table as a per-class class-dependence function beta_{i,r}(n). | |
| template<class T> | |
| FesIsolated< T > | fes_build_isolated (const Matrix< T > &rates, const Matrix< T > &stochCompS) |
| Build the isolated subnetwork's demands and visit ratios. | |
| template<class T> | |
| FesConditionalMetrics< T > | fes_compute_metrics (const Matrix< T > &L, const std::vector< int > &mi, const std::vector< bool > &isDelay, const std::vector< int > &cutoffs) |
| Per-station metrics of the ISOLATED subnetwork at every population state, the companion of fes_compute_throughputs. | |
| template<class T> | |
| std::vector< std::vector< T > > | fes_compute_throughputs (const Matrix< T > &L, const std::vector< int > &mi, const std::vector< bool > &isDelay, const std::vector< int > &cutoffs) |
| Per-class throughput table of an isolated subnetwork, tabulated over the population lattice, for use as the load-dependent rates of a flow-equivalent server (Chandy, Herzog and Woo 1975). | |
| template<class T> | |
| FesMapAggregateResult< T > | fes_map_aggregate (const std::vector< mam::Map< T > > &maps, const std::vector< double > &servers, std::size_t n, const std::vector< std::size_t > &grid, const std::string &method="ssolve") |
| Recursive MAP flow-equivalent server for a station subset. | |
| template<class T> | |
| FesMapAggregateResult< T > | fes_map_aggregate (const std::vector< mam::Map< T > > &maps, const std::vector< double > &servers, std::size_t n) |
| Aggregation on the default population grid. | |
| template<class T> | |
| mam::Map< T > | fes_map_interdeparture (const std::vector< mam::Map< T > > &maps, const std::vector< mam::Map< T > > &fes, std::size_t n) |
| Inter-departure MAP of a closed subnetwork made of one MAP station and one MAP flow-equivalent server. | |
| std::vector< std::size_t > | fes_map_grid (std::size_t n, std::size_t nhead=FES_MAP_GRID_NHEAD, std::size_t ntail=FES_MAP_GRID_NTAIL) |
| Populations at which the inter-departure MAP is evaluated. | |
| template<class T> | |
| std::vector< T > | fes_map_interp (const std::vector< T > &x, const std::vector< T > &y, const std::vector< T > &xq) |
| Monotone piecewise cubic Hermite interpolation of one series. | |
| template<class T> | |
| std::vector< mam::Map< T > > | fes_map_levels (const mam::Map< T > &map, std::size_t n, double mi=1.0) |
| Replicate a load independent MAP over n levels, scaling level k by min(k, mi). | |
| template<class T> | |
| std::vector< mam::Map< T > > | fes_map_levels (const std::vector< mam::Map< T > > &levels, std::size_t n) |
| Validate a load dependent descriptor and return its first n levels. | |
| template<class T> | |
| std::vector< T > | fes_map_euler (const std::vector< T > &v, const Matrix< T > &T0, const T &dt, double tol, std::size_t iter_max) |
| Approximate v (-T0)^-1 by the trapezoid rule with the Euler propagator. | |
| template<class T> | |
| FesMapMoments< T > | fes_map_moments (const mam::Map< T > &map, const std::string &method="ssolve", double step_safety=0.1, double tol=1e-12, std::size_t iter_max=1000000) |
| Moments and index of dispersion of an inter-departure MAP. | |
| template<class T> | |
| FesMapSolveResult< T > | fes_map_solve (const std::vector< mam::Map< T > > &fes, const mam::Map< T > &think_map, std::size_t n) |
| Closed model left by a MAP flow-equivalent server, and the per-station metrics behind it. | |
| template<class T> | |
| FesMapDeaggregateResult< T > | fes_map_deaggregate (const std::vector< T > &pk, const std::vector< T > &L, const std::vector< int > &mi, const std::vector< bool > &isDelay) |
| std::string | fes_node_type_text (qn::NodeType t) |
| NodeType.toText, so that the refusal messages read as the reference's do. | |
| template<class T> | |
| FesValidateResult | fes_validate (const qn::NetworkStruct< T > &sn, const std::vector< std::size_t > &subsetIndices) |
| Input validation for Flow-Equivalent Server (FES) aggregation. | |
| std::size_t | ljd_linearize (const std::vector< int > &nvec, const std::vector< int > &cutoffs) |
| Linearized index of a per-class population vector, for Limited Joint Dependence (LJD) tables. | |
| std::vector< int > | ljd_delinearize (std::size_t idx, const std::vector< int > &cutoffs) |
| Inverse of ljd_linearize: the population vector behind an index. | |
Variables | |
| const std::size_t | FES_MAP_GRID_NHEAD = 10 |
| Leading populations kept in full by the default grid. | |
| const std::size_t | FES_MAP_GRID_NTAIL = 10 |
| Equispaced points above them. | |
| using line::lang::CdScaling |
A class-dependent scaling map, sn.cdscaling.
It takes the per-class population vector at one station and returns the per-class rate multipliers, which is the signature pfqn_cdfun consumes; the alias resolves to the same std::function type as pfqn::CdScaling, so a map built here is passed straight through to the api layer.
Definition at line 639 of file lang_types.h.
| using line::fes::FesBetaFun = std::function<std::vector<T>(const std::vector<int>&)> |
Class-dependence handle: population vector -> per-class beta.
Definition at line 49 of file fes_beta_handle.h.
|
strong |
Scheduling disciplines, with the values of MATLAB SchedStrategy.
Definition at line 181 of file lang_types.h.
| FesAggregateResult< T > line::fes::fes_aggregate | ( | const qn::NetworkStruct< T > & | sn, |
| const std::vector< std::size_t > & | subsetIndices, | ||
| const FesOptions & | options = FesOptions() ) |
Flow-equivalent-server aggregation: replace a station subset by one station.
| sn | the original closed product-form network |
| subsetIndices | 1-BASED station indices to aggregate, the reference's base |
| options | cutoffs and verbosity |
Definition at line 124 of file fes_aggregate.h.
References line::qn::Network< T >::add_closed_class(), line::qn::Network< T >::add_delay(), line::qn::Network< T >::add_queue(), line::qn::Station< T >::cap, line::pfqn::cd_peak_scaling(), line::fes::FesAggregateResult< T >::deagg, line::mc::dtmc_stochcomp(), line::fes::FesValidateResult::errorMsg, line::lang::Distrib< T >::exp_rate(), fes_aggregate(), fes_beta_handle(), fes_build_isolated(), fes_compute_throughputs(), fes_validate(), line::fes::FesAggregateResult< T >::fesNode, line::lang::GlobalConstants::FineTol, line::InputError::InputError(), line::fes::FesValidateResult::isValid, line::fes::FesIsolated< T >::L, line::qn::Network< T >::link(), line::qn::Station< T >::name, line::qn::Station< T >::nodetype, line::qn::Station< T >::nservers, line::qn::Station< T >::sched, line::qn::RoutingMatrix< T >::set(), line::qn::Network< T >::set_capacity(), line::qn::Network< T >::set_class_dependence(), line::qn::Network< T >::set_number_of_servers(), line::qn::Network< T >::set_service(), and line::fes::FesIsolated< T >::visits.
Referenced by fes_aggregate(), and line::ctmc::solver_ctmc_fes_aggregation().
| FesBetaFun< T > line::fes::fes_beta_handle | ( | const std::vector< std::vector< T > > & | scalingTable, |
| const std::vector< int > & | cutoffs ) |
Wraps a flow-equivalent-server throughput table as a per-class class-dependence function beta_{i,r}(n).
| scalingTable | (K) linearized per-class throughput vectors, as produced by fes_compute_throughputs |
| cutoffs | (K) the population vector the table was tabulated on |
Definition at line 60 of file fes_beta_handle.h.
References fes_beta_handle(), and ljd_linearize().
Referenced by fes_aggregate(), and fes_beta_handle().
| FesIsolated< T > line::fes::fes_build_isolated | ( | const Matrix< T > & | rates, |
| const Matrix< T > & | stochCompS ) |
Build the isolated subnetwork's demands and visit ratios.
| rates | (M_sub x K) service rates of the subset stations; an entry that is zero, negative or non-finite marks a disabled service and yields a zero demand, as in the reference |
| stochCompS | (M_sub K x M_sub K) stochastic complement of the routing chain over the subset, indexed (i-1)*K + k |
Definition at line 99 of file fes_build_isolated.h.
References line::Matrix< T >::cols(), fes_build_isolated(), line::InputError::InputError(), line::fes::FesIsolated< T >::L, line::Matrix< T >::Matrix(), line::num_abs(), line::Matrix< T >::rows(), line::solve(), and line::fes::FesIsolated< T >::visits.
Referenced by fes_aggregate(), and fes_build_isolated().
| FesConditionalMetrics< T > line::fes::fes_compute_metrics | ( | const Matrix< T > & | L, |
| const std::vector< int > & | mi, | ||
| const std::vector< bool > & | isDelay, | ||
| const std::vector< int > & | cutoffs ) |
Per-station metrics of the ISOLATED subnetwork at every population state, the companion of fes_compute_throughputs.
| L | (M_sub x K) service demands of the isolated subnetwork |
| mi | (M_sub) servers per station; a delay station's entry is ignored |
| isDelay | (M_sub) true where the station is a pure delay |
| cutoffs | (K) per-class population cutoffs |
Definition at line 60 of file fes_compute_metrics.h.
References line::Matrix< T >::cols(), fes_compute_metrics(), line::InputError::InputError(), ljd_delinearize(), line::pfqn::pfqn_mvams(), line::fes::FesConditionalMetrics< T >::QN, line::pfqn::MvaResult< T >::QN, line::Matrix< T >::rows(), line::fes::FesConditionalMetrics< T >::UN, and line::pfqn::MvaResult< T >::XN.
Referenced by fes_compute_metrics(), and line::ctmc::solver_ctmc_fes_aggregation().
| std::vector< std::vector< T > > line::fes::fes_compute_throughputs | ( | const Matrix< T > & | L, |
| const std::vector< int > & | mi, | ||
| const std::vector< bool > & | isDelay, | ||
| const std::vector< int > & | cutoffs ) |
Per-class throughput table of an isolated subnetwork, tabulated over the population lattice, for use as the load-dependent rates of a flow-equivalent server (Chandy, Herzog and Woo 1975).
| L | (M_sub x K) service demands of the isolated subnetwork |
| mi | (M_sub) servers per station; entries of delay stations are ignored (MATLAB stores Inf there) |
| isDelay | (M_sub) true where the station is a pure delay |
| cutoffs | (K) per-class population cutoffs |
Definition at line 61 of file fes_compute_throughputs.h.
References line::Matrix< T >::cols(), fes_compute_throughputs(), line::InputError::InputError(), ljd_linearize(), line::next_pop(), line::pfqn::pfqn_mvams(), line::Matrix< T >::rows(), and line::pfqn::MvaResult< T >::XN.
Referenced by fes_aggregate(), and fes_compute_throughputs().
| FesMapAggregateResult< T > line::fes::fes_map_aggregate | ( | const std::vector< mam::Map< T > > & | maps, |
| const std::vector< double > & | servers, | ||
| std::size_t | n ) |
Aggregation on the default population grid.
Definition at line 143 of file fes_map_aggregate.h.
References fes_map_aggregate(), and fes_map_grid().
| FesMapAggregateResult< T > line::fes::fes_map_aggregate | ( | const std::vector< mam::Map< T > > & | maps, |
| const std::vector< double > & | servers, | ||
| std::size_t | n, | ||
| const std::vector< std::size_t > & | grid, | ||
| const std::string & | method = "ssolve" ) |
Recursive MAP flow-equivalent server for a station subset.
| maps | service process of each station, already scaled by its visit ratio |
| servers | number of servers of each station, infinite for a delay |
| n | largest population the flow-equivalent server must serve |
| grid | populations at which the inter-departure MAP is evaluated |
| method | moment evaluation method, "ssolve" or "euler" |
Definition at line 76 of file fes_map_aggregate.h.
References line::fes::FesMapMoments< T >::e1, line::fes::FesMapMoments< T >::e2, line::fes::FesMapMoments< T >::e3, line::fes::FesMapAggregateResult< T >::fes, fes_map_aggregate(), fes_map_interdeparture(), fes_map_interp(), fes_map_levels(), fes_map_moments(), line::fes::FesMapAggregateResult< T >::grid, line::fes::FesMapMoments< T >::idc, line::InputError::InputError(), line::mam::Map2FitIdcResult< T >::map, line::mam::map2_fit_idc(), line::mam::map_idc(), line::mam::map_moment(), line::fes::FesMapAggregateResult< T >::moments, line::fes::FesMapAggregateResult< T >::status, line::mam::Map2FitIdcResult< T >::status, and line::fes::FesMapAggregateResult< T >::throughput.
Referenced by fes_map_aggregate(), and fes_map_aggregate().
| FesMapDeaggregateResult< T > line::fes::fes_map_deaggregate | ( | const std::vector< T > & | pk, |
| const std::vector< T > & | L, | ||
| const std::vector< int > & | mi, | ||
| const std::vector< bool > & | isDelay ) |
| pk | law of the jobs held by the aggregate, index k = P(k jobs) |
| L | service demands of the isolated subnetwork |
| mi | servers per station, ignored where isDelay |
| isDelay | true where the station is a pure delay |
Definition at line 120 of file fes_map_solve.h.
References fes_map_deaggregate(), line::pfqn::pfqn_mva(), line::fes::FesMapDeaggregateResult< T >::Q, line::pfqn::MvaResult< T >::QN, line::fes::FesMapDeaggregateResult< T >::R, line::fes::FesMapDeaggregateResult< T >::U, line::pfqn::MvaResult< T >::UN, line::fes::FesMapDeaggregateResult< T >::X, and line::pfqn::MvaResult< T >::XN.
Referenced by fes_map_deaggregate().
| std::vector< T > line::fes::fes_map_euler | ( | const std::vector< T > & | v, |
| const Matrix< T > & | T0, | ||
| const T & | dt, | ||
| double | tol, | ||
| std::size_t | iter_max ) |
Approximate v (-T0)^-1 by the trapezoid rule with the Euler propagator.
| v | row vector to be multiplied by (-T0)^-1 |
| T0 | hidden transitions of the MAP, a stable matrix |
| dt | integration step, below 1/max(abs(diag(T0))) |
| tol | relative mass left when the integration stops |
| iter_max | maximum number of integration steps |
Definition at line 80 of file fes_map_moments.h.
References fes_map_euler(), and line::vecmul().
Referenced by fes_map_euler(), and fes_map_moments().
|
inline |
Populations at which the inter-departure MAP is evaluated.
Fitting one MAP per population is wasteful because the processes of neighbouring populations are similar; the reference evaluates the first ten populations and ten further equispaced points.
Definition at line 48 of file fes_map_interp.h.
References fes_map_grid(), FES_MAP_GRID_NHEAD, and FES_MAP_GRID_NTAIL.
Referenced by fes_map_aggregate(), and fes_map_grid().
| mam::Map< T > line::fes::fes_map_interdeparture | ( | const std::vector< mam::Map< T > > & | maps, |
| const std::vector< mam::Map< T > > & | fes, | ||
| std::size_t | n ) |
Inter-departure MAP of a closed subnetwork made of one MAP station and one MAP flow-equivalent server.
| maps | per-level service processes of the station, index j-1 holding j jobs |
| fes | per-level processes of the flow-equivalent server, index k-1 holding k jobs |
| n | number of jobs circulating in the subnetwork |
Definition at line 56 of file fes_map_interdeparture.h.
References line::mam::Map< T >::D0, line::mam::Map< T >::D1, fes_map_interdeparture(), fes_map_levels(), line::InputError::InputError(), and line::Matrix< T >::Matrix().
Referenced by fes_map_aggregate(), fes_map_interdeparture(), and fes_map_solve().
| std::vector< T > line::fes::fes_map_interp | ( | const std::vector< T > & | x, |
| const std::vector< T > & | y, | ||
| const std::vector< T > & | xq ) |
Monotone piecewise cubic Hermite interpolation of one series.
| x | sample abscissae, strictly increasing |
| y | sample values |
| xq | query abscissae |
Definition at line 99 of file fes_map_interp.h.
References fes_map_interp().
Referenced by fes_map_aggregate(), and fes_map_interp().
| std::vector< mam::Map< T > > line::fes::fes_map_levels | ( | const mam::Map< T > & | map, |
| std::size_t | n, | ||
| double | mi = 1.0 ) |
Replicate a load independent MAP over n levels, scaling level k by min(k, mi).
Definition at line 38 of file fes_map_levels.h.
References line::mam::Map< T >::D0, line::mam::Map< T >::D1, and fes_map_levels().
Referenced by fes_map_aggregate(), fes_map_interdeparture(), fes_map_levels(), fes_map_levels(), and fes_map_solve().
| std::vector< mam::Map< T > > line::fes::fes_map_levels | ( | const std::vector< mam::Map< T > > & | levels, |
| std::size_t | n ) |
Validate a load dependent descriptor and return its first n levels.
Definition at line 57 of file fes_map_levels.h.
References fes_map_levels(), and line::InputError::InputError().
| FesMapMoments< T > line::fes::fes_map_moments | ( | const mam::Map< T > & | map, |
| const std::string & | method = "ssolve", | ||
| double | step_safety = 0.1, | ||
| double | tol = 1e-12, | ||
| std::size_t | iter_max = 1000000 ) |
Moments and index of dispersion of an inter-departure MAP.
| map | the pair (T0, T1) of the inter-departure MAP |
| method | "ssolve" for the linear solve, "euler" for the quadrature |
| step_safety | fraction of the uniformization bound used as Euler step |
| tol | relative mass left when the Euler quadrature stops |
| iter_max | maximum number of Euler integration steps |
Definition at line 112 of file fes_map_moments.h.
References line::mc::ctmc_solve(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, line::fes::FesMapMoments< T >::e1, line::fes::FesMapMoments< T >::e11, line::fes::FesMapMoments< T >::e2, line::fes::FesMapMoments< T >::e3, fes_map_euler(), fes_map_moments(), line::fes::FesMapMoments< T >::idc, line::InputError::InputError(), line::mam::map_infgen(), line::Matrix< T >::rows(), and line::vecmul().
Referenced by fes_map_aggregate(), and fes_map_moments().
| FesMapSolveResult< T > line::fes::fes_map_solve | ( | const std::vector< mam::Map< T > > & | fes, |
| const mam::Map< T > & | think_map, | ||
| std::size_t | n ) |
Closed model left by a MAP flow-equivalent server, and the per-station metrics behind it.
| fes | flow-equivalent server, one MAP per level |
| think_map | think time process (Z0,Z1) |
| n | number of jobs in the closed model |
Definition at line 81 of file fes_map_solve.h.
References line::mc::ctmc_solve(), line::mam::Map< T >::D1, fes_map_interdeparture(), fes_map_levels(), fes_map_solve(), line::InputError::InputError(), line::mam::map_infgen(), line::mam::map_moment(), line::fes::FesMapSolveResult< T >::pk, line::fes::FesMapSolveResult< T >::Q, line::fes::FesMapSolveResult< T >::R, line::Matrix< T >::rows(), line::vecmul(), and line::fes::FesMapSolveResult< T >::X.
Referenced by fes_map_solve().
|
inline |
NodeType.toText, so that the refusal messages read as the reference's do.
Definition at line 58 of file fes_validate.h.
References fes_node_type_text(), and line::InputError::InputError().
Referenced by fes_node_type_text(), and fes_validate().
| FesValidateResult line::fes::fes_validate | ( | const qn::NetworkStruct< T > & | sn, |
| const std::vector< std::size_t > & | subsetIndices ) |
Input validation for Flow-Equivalent Server (FES) aggregation.
| sn | the network structure |
| subsetIndices | 1-based station indices to aggregate, matching the reference's index base so that the messages agree |
Definition at line 85 of file fes_validate.h.
References line::fes::FesValidateResult::errorMsg, fes_node_type_text(), fes_validate(), line::fes::FesValidateResult::isValid, and line::api::sn_is_open_model().
Referenced by fes_aggregate(), and fes_validate().
|
inline |
Inverse of ljd_linearize: the population vector behind an index.
The forward map is a mixed-radix numeral with class k in radix (Nk+1), so the inverse is the digit-by-digit division that reads it back. It is what lets a caller walk a tabulated dependence in index order and still know which population each entry belongs to.
| idx | the 1-based linearized index |
| cutoffs | per-class cutoffs |
Definition at line 70 of file ljd_linearize.h.
References ljd_delinearize().
Referenced by fes_compute_metrics(), and ljd_delinearize().
|
inline |
Linearized index of a per-class population vector, for Limited Joint Dependence (LJD) tables.
| nvec | per-class populations |
| cutoffs | per-class cutoffs, same length as nvec |
Definition at line 45 of file ljd_linearize.h.
References line::InputError::InputError(), and ljd_linearize().
Referenced by fes_beta_handle(), fes_compute_throughputs(), ljd_linearize(), and line::ctmc::solver_ctmc_fes_aggregation().
| const std::size_t line::fes::FES_MAP_GRID_NHEAD = 10 |
Leading populations kept in full by the default grid.
Definition at line 38 of file fes_map_interp.h.
Referenced by fes_map_grid().
| const std::size_t line::fes::FES_MAP_GRID_NTAIL = 10 |
Equispaced points above them.
Definition at line 40 of file fes_map_interp.h.
Referenced by fes_map_grid().