![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of @@SolverCTMC/getCdfRespT.m and @@SolverCTMC/getCdfSysRespT.m: the exact distribution of the response time, not just its mean. More...
#include <cmath>#include <cstddef>#include <limits>#include <string>#include <utility>#include <vector>#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.h"#include "line/lang/qn/network_struct.h"#include "line/lang/qn/state_events.h"#include "line/lang/qn/tag_chain.h"#include "line/solvers/ctmc/solver_ctmc.h"#include "line/solvers/ctmc/solver_ctmc_analyzer.h"#include "line/util/error.h"#include "line/util/expm.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::ctmc::CdfCurve< T > |
| A CDF as the reference returns it: the value at each point of the time grid. More... | |
Namespaces | |
| namespace | line |
| namespace | line::ctmc |
Functions | |
| template<class T> | |
| std::vector< std::vector< CdfCurve< T > > > | line::ctmc::solver_ctmc_cdf_respt (const NetworkStruct< T > &sn, const CtmcOptions &opt) |
| Port of @@SolverCTMC/getCdfRespT.m: the per-(station, class) response-time CDF, indexed [ist-1][r-1]. | |
| template<class T> | |
| std::vector< CdfCurve< T > > | line::ctmc::solver_ctmc_cdf_sys_respt (const NetworkStruct< T > &sn, const CtmcOptions &opt) |
| Port of @@SolverCTMC/getCdfSysRespT.m: the per-chain SYSTEM response-time CDF, indexed by chain. | |
Port of @@SolverCTMC/getCdfRespT.m and @@SolverCTMC/getCdfSysRespT.m: the exact distribution of the response time, not just its mean.
THE CONSTRUCTION. Tag one job of a chain (tag_chain), build the generator of the tagged model WITH its event filtration, and then read the passage of the tagged job off the filtration as a MAP:
A = map_normalize({Q - A1, A1}) A1 = the tagged job ARRIVING at station i D = map_normalize({Q - D1, D1}) D1 = the tagged job DEPARTING station i
map_pie(A) is the state of the WHOLE NETWORK as the tagged job sees it on arrival – the arrival theorem made exact, with no product form assumed – and from that state the passage ends at the first D1 event. So D0 = D.D0 is the sub-generator of "the tagged job is still in station i", and
F(t) = 1 - pie_arv exp(D0 t) e
is the response-time CDF. getCdfSysRespT is the same object with the split taken at the tagged job's ARRIVAL at its own reference station, so the passage is one full cycle of the network rather than one visit to one station.
WHY THE FILTRATION IS INDISPENSABLE. Q has already summed every synchronization's contribution into one entry, and A1 is one synchronization's share of it; no post-processing of Q can separate them. That is what CtmcOptions::keep_filtration is for, and it is forced on below.
WHAT IS DELIBERATELY NOT REPRODUCED. The reference recomputes expm(D0*t) from scratch at each of the 100001 grid points (or calls expmv where the MATLAB release has it). On a uniform grid that is pure waste: exp(D0 k dt) is exp(D0 dt)^k exactly, so ONE matrix exponential and one vector-matrix product per point give the same curve. The recurrence is stable because exp(D0 dt) is substochastic – its powers contract – so the rounding of a step is damped by every step after it rather than amplified.
Definition in file solver_ctmc_cdf.h.