![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
The state-dependent fluid drifts: ports of ode_statedep.m, ode_softmin.m and ode_pnorm.m. More...
#include <cmath>#include <cstddef>#include <functional>#include <string>#include <vector>#include "line/lang/qn/network_struct.h"#include "line/solvers/fluid/fluid_odes.h"#include "line/util/error.h"Go to the source code of this file.
Classes | |
| struct | line::fluid::FluidStateDepSystem |
| Everything the state-dependent drifts read, lowered once to doubles. More... | |
Namespaces | |
| namespace | line |
| namespace | line::fluid |
Enumerations | |
| enum class | line::fluid::StateDepKind { line::fluid::StateDep , line::fluid::SoftMin , line::fluid::PNorm } |
| Which smoothing the drift applies at a saturated station. More... | |
Functions | |
| template<class T> | |
| FluidStateDepSystem | line::fluid::fluid_statedep_system (const qn::NetworkStruct< T > &sn, StateDepKind kind, double alpha=20.0, double pstar=20.0) |
| Assemble what the state-dependent drifts need from sn. | |
| std::function< void(double, const double *, double *)> | line::fluid::fluid_drift_statedep (const FluidStateDepSystem &s) |
| The drift dx/dt for the state-dependent family. | |
The state-dependent fluid drifts: ports of ode_statedep.m, ode_softmin.m and ode_pnorm.m.
HOW THESE DIFFER FROM closing. The closing drift factors every rate into a constant times one state entry, which is why it can precompute rateBase and evaluate the drift as a sum over events. These three cannot: the server share a job receives depends on the whole station's occupancy, and for FCFS on the MEAN SERVICE TIME OF THE PHASE the job is in, so the multiplier changes per (class, phase) at every step. They are therefore written the way the reference writes them – accumulate directly into dx, station by station – and are correspondingly slower. That is the trade the reference names in its own comment: "slower than ODE_RATES_STATEINDEP, but allows rates that are more complex functions of x".
WHAT THE THREE VARY. Only how a saturated station's capacity enters:
statedep the hard min(ni, c), which has a kink at ni = c softmin softmin(ni, c, alpha), the weighted average (x e^-ax + y e^-ay)/(e^-ax + e^-ay), smooth everywhere pnorm ghat = 1/(1 + (ni/c)^p)^(1/p), a smooth stand-in for min(1, c/ni) from Ruuskanen et al., PEVA 151 (2021)
The kink is what makes the closing/statedep drift stiff near saturation, and smoothing it is what lets the integrator take longer steps. The fixed point moves slightly in exchange, which is why these are separate methods rather than a faster way to compute the same answer.
OPEN MODELS ARE REFUSED. ode_statedep.m errors on an EXT station – the family has no source term – and so does this port, by name.
A NOTE ON TWO REFERENCE ASYMMETRIES, both reproduced deliberately.
Definition in file fluid_odes_statedep.h.