LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
fluid_aoi.h File Reference

Age of Information by Markovian fluid queues: a port of solver_mfq_aoi.m (identical to solver_fluid_aoi.m) with the gate aoi_is_aoi.m, the parameter map aoi_extract_params.m, and the two aoi-fluid algorithms solveBufferless.m and solveSingleBuffer.m. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <limits>
#include <string>
#include <vector>
#include "line/api/aoi/aoi_dist2ph.h"
#include "line/api/mam/mmap_lambda.h"
#include "line/lang/qn/network_struct.h"
#include "line/util/eig.h"
#include "line/util/error.h"
#include "line/util/expm.h"
#include "line/util/linalg.h"
#include "line/util/lstsq.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for fluid_aoi.h:

Go to the source code of this file.

Classes

struct  line::fluid::AoiTopology
 What the AoI gate found, when it matches. More...
struct  line::fluid::AoiParams
 The (tau, T) / (sigma, S) pairs and the preemption probability. More...
struct  line::fluid::AoiMe
 A matrix-exponential age law: P(age > t) = g exp(A t) h. More...
struct  line::fluid::AoiSolution
 Both age laws of one system, with the policy parameter that produced them. More...
struct  line::fluid::FluidAoiResult
 What the AoI branch of mfq returns: the age laws and the metrics beside them. More...

Namespaces

namespace  line
namespace  line::fluid

Functions

template<class T>
AoiTopology line::fluid::aoi_is_aoi (const qn::NetworkStruct< T > &sn)
 Port of aoi_is_aoi.m.
template<class T>
AoiParams line::fluid::aoi_extract_params (const qn::NetworkStruct< T > &sn, const AoiTopology &top, double preempt_override)
 Port of aoi_extract_params.m.
AoiSolution line::fluid::aoi_solve_bufferless (const std::vector< double > &tau, const Matrix< double > &Tm, const std::vector< double > &sigma, const Matrix< double > &Sm, double p)
 Port of solveBufferless.m: the AoI and PAoI laws of a PH/PH/1/1 system in which an arrival meeting a busy server preempts it with probability p.
AoiSolution line::fluid::aoi_solve_singlebuffer (double lambda, const std::vector< double > &sigma, const Matrix< double > &Sm, double r)
 Port of solveSingleBuffer.m: the AoI and PAoI laws of an M/PH/1/2 system in which a waiting update is replaced by a fresher arrival with probability r.
double line::fluid::aoi_cdf (const AoiMe &me, double t)
 getCdfAoI: F(t) = 1 - S(t) with S the survival function of the age law.
template<class T>
FluidAoiResult line::fluid::fluid_aoi (const qn::NetworkStruct< T > &sn, const AoiTopology &top, double preempt_override)
 Port of solver_mfq_aoi.m.

Detailed Description

Age of Information by Markovian fluid queues: a port of solver_mfq_aoi.m (identical to solver_fluid_aoi.m) with the gate aoi_is_aoi.m, the parameter map aoi_extract_params.m, and the two aoi-fluid algorithms solveBufferless.m and solveSingleBuffer.m.

WHAT AGE OF INFORMATION IS. Not a delay of a job but the freshness of the information a monitor holds: at time t, the age is t minus the generation time of the most recent update DELIVERED so far. It grows at unit rate and drops on every delivery, so its mean depends on the whole delivery process and not only on the response time – a queue that delivers late but often can beat one that delivers fast and rarely. Peak AoI (PAoI) is the value reached just before a drop.

WHY A FLUID QUEUE COMPUTES IT. The age is a sawtooth: it climbs with slope +1 and resets. That is exactly the sample path of a Markov-modulated fluid queue with drift +1 in every state but one, so the stationary age distribution is the stationary distribution of an MFQ level, and it comes out as a MATRIX-EXPONENTIAL triple (g, A, h): P(AoI > t) = g exp(A t) h. Both algorithms build the modulating chain of the age process, then solve one linear system for g and read the moments off A. The reference for the pair is the aoi-fluid toolbox of Dogan, Akar and Atay (BSD 2-Clause, 2020).

THE TWO SYSTEMS COVERED, and no others: a BUFFERLESS PH/PH/1/1 where an arrival meeting a busy server is discarded (p = 0) or preempts it (p = 1), and a SINGLE-BUFFER M/PH/1/2 where a waiting update is kept (r = 0) or REPLACED by a fresher one (r = 1). Anything else – more capacity, more servers, more classes, a second queue – is refused by name.

WHERE p AND r COME FROM. aoi_extract_params.m reads the scheduling policy: FCFS gives no preemption and no replacement, LCFS-PR preempts, and LCFS replaces in the buffered system while behaving non-preemptively in the bufferless one. FluidOptions::aoi_preemption overrides both, as options.config.aoi_preemption does in the reference.

A CAVEAT THE REFERENCE CARRIES AND THIS PORT KEEPS. aoi_dist2ph builds the PH pair from the (D0, D1) MAP with alpha proportional to theta .* (D1 e), which is the phase distribution AT A COMPLETION rather than at a start. For a multi-phase Erlang the two differ, so the mean service time the AoI branch uses is not the distribution's mean (Erlang(2) with mean 1 is read as mean 0.5). The standard metrics reported alongside AoI inherit that reading. This is reproduced exactly, because MATLAB is the reference and the AoI numbers would otherwise not match; it is called out here so it is never mistaken for a defect of this port.

THE STANDARD METRICS ARE AN M/M/1 APPROXIMATION, as the reference states in so many words: QN = rho/(1 - rho) and RN = 1/(mu - lambda) with mu the reciprocal of the mean service time above. They are NOT the metrics of the finite-capacity system being analyzed, which by construction holds at most one or two jobs; the AoI numbers are the output that means something here.

Definition in file fluid_aoi.h.