![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Controls, defaulting to SolverOptions('Fluid') in the reference. More...
#include <line/solvers/fluid/solver_fluid.h>
Classes | |
| struct | RateSched |
| options.config.rate_sched: explicit per-(station, class) rate trajectories, the third source solver_fluid_ratemult composes. More... | |
Public Attributes | |
| std::string | method = "default" |
| double | tol = 1e-4 |
| absolute and relative tolerance handed to the integrator | |
| double | iter_tol = 0.0 |
| >0 stops early when the moved-mass ratio falls below it; 0 runs to iter_max, as the reference does | |
| bool | earlystop = true |
| options.config.fluid_earlystop: stop on the geometric tail of the window iteration | |
| std::size_t | iter_max = 200 |
| cap on outer integrations | |
| std::size_t | nonmkv_order = 20 |
| options.config.nonmkvorder: the phase budget sn_nonmarkov_toph spends on a non-Markovian service law. | |
| double | timespan_end = std::numeric_limits<double>::infinity() |
| std::vector< double > | init_sol |
| initial state; empty selects the default below | |
| std::vector< double > | kp_init_sol |
| options.config.kp_init_sol: the kp method's initial state, in the KO-PENDER layout – one offset counter walking the stations in order, an arrival-phase block at each EXT station-class and a service-phase block at every other, with no mass returning to the source. | |
| Matrix< double > | init_cov |
| options.config.init_cov: the kp method's initial covariance Sigma(0), dim-by-dim in the same layout as kp_init_sol. | |
| double | softmin_alpha = 20.0 |
| sharpness of the 'softmin' smoothing | |
| double | pstar = 20.0 |
| exponent of the 'pnorm' smoothing | |
| bool | pstar_set = false |
| Opt in to the p-norm under matrix/default too, which is what options.config.pstar does in MATLAB, the JAR and native Python. | |
| std::string | fork_join = "default" |
| options.config.fork_join: which fork-join arm the fixed point takes, 'default'/'mmt'/'fjt' or 'ht'. | |
| double | timestep = 0.01 |
| 'diffusion' Euler-Maruyama step | |
| unsigned long | seed = 23000 |
| 'diffusion' RNG seed | |
| bool | stiff = false |
| options.stiff: integrate the closing family with the explicit stiff arm of fluid_stiff.h rather than with LSODA. | |
| bool | hide_immediate = true |
| options.config.hide_immediate: fold the Immediate-rate transitions into the timed ones by stochastic complementation before integrating. | |
| double | aoi_preemption = -1.0 |
| options.config.aoi_preemption: the preemption (bufferless) or replacement (single buffer) probability of the AoI branch of mfq. | |
| FluidClosure | closure |
| options.config.moment_sigma2 and options.config.moment_cov: the second moment the drift's non-linear terms are closed with. | |
| std::size_t | moment_maxstate = 200 |
| options.config.moment_maxstate: the largest phase-resolved state the moment-closure methods will build a covariance over. | |
| std::size_t | dae_maxstate = 0 |
| options.config.dae_maxstate and options.config.dae_maxcov: the DAE route's own two refusal thresholds, on the simultaneous solve and on the covariance it integrates alongside the mean. | |
| std::size_t | dae_maxcov = 0 |
| std::string | highvar = "default" |
| options.config.highvar: which non-exponential FCFS correction the analyzer's outer refit loop applies, interp (the WSC 2020 diffusion interpolation) or default/none/hvmva (no rescaling, so the loop converges after one sweep). | |
| FluidRateMult | rate_traj |
| options.config.rate_traj = {tgrid, Mmat}: a caller-supplied per-EVENT multiplier, which is what the coupled LN layer transient injects. | |
| std::vector< std::pair< std::size_t, std::size_t > > | nhpp_sched |
| options.config.nhpp_sched: the (station, class) pairs whose SOURCE carries a non-homogeneous intensity, which the drift is to follow exactly rather than at its time average. | |
| std::vector< RateSched > | rate_sched |
Controls, defaulting to SolverOptions('Fluid') in the reference.
Definition at line 88 of file solver_fluid.h.
| double line::fluid::FluidOptions::aoi_preemption = -1.0 |
options.config.aoi_preemption: the preemption (bufferless) or replacement (single buffer) probability of the AoI branch of mfq.
Negative selects the value the scheduling policy implies.
Definition at line 168 of file solver_fluid.h.
| FluidClosure line::fluid::FluidOptions::closure |
options.config.moment_sigma2 and options.config.moment_cov: the second moment the drift's non-linear terms are closed with.
A CALLER DOES NOT SET THIS. solver_fluid_moments does, once per sweep of its outer fixed point, and it is on the options because the mean solve is the ORDINARY closing integration – the closure has to reach the drift without a second entry point that could drift from the first.
Definition at line 178 of file solver_fluid.h.
Referenced by line::fluid::solver_fluid_dae(), and line::fluid::solver_fluid_moments().
| std::size_t line::fluid::FluidOptions::dae_maxcov = 0 |
Definition at line 199 of file solver_fluid.h.
| std::size_t line::fluid::FluidOptions::dae_maxstate = 0 |
options.config.dae_maxstate and options.config.dae_maxcov: the DAE route's own two refusal thresholds, on the simultaneous solve and on the covariance it integrates alongside the mean.
ZERO MEANS NOT SET, and that is what makes them options rather than a second copy of the defaults: the route reads them off FluidDaeOptions, whose own values a caller may pin directly, and fluid_dae_options lets an explicit pin stand wherever the options are silent. A user reaching for the knob writes the option, as in the other three codebases; a test pinning one writes the struct.
Definition at line 198 of file solver_fluid.h.
| bool line::fluid::FluidOptions::earlystop = true |
options.config.fluid_earlystop: stop on the geometric tail of the window iteration
Definition at line 92 of file solver_fluid.h.
| std::string line::fluid::FluidOptions::fork_join = "default" |
options.config.fork_join: which fork-join arm the fixed point takes, 'default'/'mmt'/'fjt' or 'ht'.
Carried here so that a fluid solve of a fork-join model selects the same transform an MVA or NC solve of it would; see the has_fork branch of fluid_runner.h.
Definition at line 140 of file solver_fluid.h.
| bool line::fluid::FluidOptions::hide_immediate = true |
options.config.hide_immediate: fold the Immediate-rate transitions into the timed ones by stochastic complementation before integrating.
Off in the reference too, which reaches ode_eliminate_immediate only when the caller asks for it.
Definition at line 162 of file solver_fluid.h.
| std::string line::fluid::FluidOptions::highvar = "default" |
options.config.highvar: which non-exponential FCFS correction the analyzer's outer refit loop applies, interp (the WSC 2020 diffusion interpolation) or default/none/hvmva (no rescaling, so the loop converges after one sweep).
THE DEFAULT IS default, i.e. NO rescaling, because that is what SolverOptions.m:127 sets for FLD – NC is the solver that defaults to interp. The refit loop still runs: with no rescaling it refits each FCFS station to a Coxian at its own mean and SCV, which is an identity on a declared Coxian and a two-moment reduction on anything else, and it converges in two sweeps because eta is constant. See fluid_nonexp.h.
Definition at line 213 of file solver_fluid.h.
| Matrix<double> line::fluid::FluidOptions::init_cov |
options.config.init_cov: the kp method's initial covariance Sigma(0), dim-by-dim in the same layout as kp_init_sol.
A caller that carries a DISTRIBUTION across a handoff supplies the second moment beside the mean, so the next stage does not restart from a point mass it never had. Empty keeps the default diag(theta) - theta theta' of the initial arrival phase.
Definition at line 124 of file solver_fluid.h.
| std::vector<double> line::fluid::FluidOptions::init_sol |
initial state; empty selects the default below
Definition at line 101 of file solver_fluid.h.
Referenced by line::fluid::solver_fld_cacheqn_analyzer(), line::fluid::solver_fld_cacheqn_tran(), line::fluid::solver_fluid_closing(), and line::fluid::solver_fluid_transient().
| std::size_t line::fluid::FluidOptions::iter_max = 200 |
cap on outer integrations
Definition at line 93 of file solver_fluid.h.
| double line::fluid::FluidOptions::iter_tol = 0.0 |
>0 stops early when the moved-mass ratio falls below it; 0 runs to iter_max, as the reference does
Definition at line 91 of file solver_fluid.h.
| std::vector<double> line::fluid::FluidOptions::kp_init_sol |
options.config.kp_init_sol: the kp method's initial state, in the KO-PENDER layout – one offset counter walking the stations in order, an arrival-phase block at each EXT station-class and a service-phase block at every other, with no mass returning to the source.
NOT init_sol, which is laid out for the CLOSING state vector: the two can have the same length on the same model, so sharing one field lets a closing-layout seed be consumed here, silently zeroing the source phase mass and with it the whole network. Empty selects the stationary arrival phase; a wrong-sized seed is refused rather than ignored.
Definition at line 114 of file solver_fluid.h.
| std::string line::fluid::FluidOptions::method = "default" |
Definition at line 89 of file solver_fluid.h.
Referenced by line::fluid::solver_fld_cacheqn_analyzer(), line::fluid::solver_fld_cacheqn_tran(), line::fluid::solver_fluid_closing(), line::fluid::solver_fluid_dae(), line::fluid::solver_fluid_export_odes(), line::fluid::solver_fluid_moments(), line::fluid::solver_fluid_run_analyzer(), line::fluid::solver_fluid_run_transient(), and line::fluid::solver_fluid_tran_avg_var().
| std::size_t line::fluid::FluidOptions::moment_maxstate = 200 |
options.config.moment_maxstate: the largest phase-resolved state the moment-closure methods will build a covariance over.
The Lyapunov solve is cubic in it, so this is a refusal threshold and not a tuning knob; it also decides whether default resolves to minnormal at all.
Definition at line 185 of file solver_fluid.h.
| std::vector<std::pair<std::size_t, std::size_t> > line::fluid::FluidOptions::nhpp_sched |
options.config.nhpp_sched: the (station, class) pairs whose SOURCE carries a non-homogeneous intensity, which the drift is to follow exactly rather than at its time average.
IT IS A LIST AND NOT A FLAG, and that is the reference's design. A model can declare an NHPP and still be solved at the nominal – that is what solver_fluid.m does for a steady-state request – so the schedule enters the drift only when a caller asks for it, which in the reference is @@SolverFLD/getTranAvg through local_detect_nhpp. fluid_detect_nhpp below is that detector; a caller that wants the nominal simply does not call it. 1-based (station, class)
Definition at line 233 of file solver_fluid.h.
Referenced by line::fluid::solver_fluid_transient().
| std::size_t line::fluid::FluidOptions::nonmkv_order = 20 |
options.config.nonmkvorder: the phase budget sn_nonmarkov_toph spends on a non-Markovian service law.
The fluid path always takes the PH fit, so this is the Bernstein order.
Definition at line 99 of file solver_fluid.h.
| double line::fluid::FluidOptions::pstar = 20.0 |
exponent of the 'pnorm' smoothing
Definition at line 126 of file solver_fluid.h.
| bool line::fluid::FluidOptions::pstar_set = false |
Opt in to the p-norm under matrix/default too, which is what options.config.pstar does in MATLAB, the JAR and native Python.
The exponent above is a default, not a request, so it cannot serve as the flag: leaving it at 20 must keep the hard min() under matrix.
Definition at line 133 of file solver_fluid.h.
| std::vector<RateSched> line::fluid::FluidOptions::rate_sched |
Definition at line 248 of file solver_fluid.h.
| FluidRateMult line::fluid::FluidOptions::rate_traj |
options.config.rate_traj = {tgrid, Mmat}: a caller-supplied per-EVENT multiplier, which is what the coupled LN layer transient injects.
Mmat must have one row per event of the closing ODE.
Definition at line 219 of file solver_fluid.h.
| unsigned long line::fluid::FluidOptions::seed = 23000 |
'diffusion' RNG seed
Definition at line 142 of file solver_fluid.h.
| double line::fluid::FluidOptions::softmin_alpha = 20.0 |
sharpness of the 'softmin' smoothing
Definition at line 125 of file solver_fluid.h.
| bool line::fluid::FluidOptions::stiff = false |
options.stiff: integrate the closing family with the explicit stiff arm of fluid_stiff.h rather than with LSODA.
THE DEFAULT IS FALSE WHERE THE REFERENCE'S IS TRUE, and that is not a downgrade. options.stiff = true selects ode15s, a variable-order BDF code; LSODA is a variable-order Adams/BDF code that switches to BDF on its own stiffness detector, so the reference's default arm is the one already taken here. Setting this selects the four-stage Rosenbrock method, which is the family ode23s belongs to – the reference's OTHER arm – so the flag names the integrator that is actually different.
Definition at line 155 of file solver_fluid.h.
| double line::fluid::FluidOptions::timespan_end = std::numeric_limits<double>::infinity() |
Definition at line 100 of file solver_fluid.h.
Referenced by line::fluid::solver_fluid_dae(), and line::fluid::solver_fluid_dae_transient().
| double line::fluid::FluidOptions::timestep = 0.01 |
'diffusion' Euler-Maruyama step
Definition at line 141 of file solver_fluid.h.
| double line::fluid::FluidOptions::tol = 1e-4 |
absolute and relative tolerance handed to the integrator
Definition at line 90 of file solver_fluid.h.
Referenced by line::fluid::solver_fluid_transient().