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::AoiQueueMetrics
 Stationary metrics of the finite-capacity AoI queue (at most 1 or 2 updates). More...
struct  line::fluid::FluidAoiResult
 What the AoI branch of mfq returns: the age laws and the metrics beside them. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
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.
AoiQueueMetrics line::fluid::aoi_queue_metrics (const AoiParams &par, double capacity)
 Exact metrics from the explicit CTMC of the system the age laws describe.
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.

THE PH PAIR. aoi_dist2ph builds the PH from the (D0, D1) MAP with entry vector map_pie = theta D1 / (theta D1 e), the phase a renewal RESTARTS in. Until 2026-11-14 it used theta .* (D1 e), the phase a completion OCCURRED in, which read Erlang(2) of mean 1 as Exp(2) of mean 0.5; fixed in all four codebases.

THE STANDARD METRICS ARE THOSE OF THE FINITE-CAPACITY SYSTEM ANALYZED, from the stationary vector of its explicit CTMC (aoi_queue_metrics): the bufferless PH/PH/1/1 with preemption p, or the single-buffer M/PH/1/2 with replacement r. Until 2026-11-14 they were the infinite-buffer M/M/1 rho/(1 - rho), which gave QN = 1 at a capacity-1 station with UN = 0.5. TN is the DELIVERED throughput (completions) and RN = QN / TN, the convention fluid_analyzer_correct (solver_fluid_analyzer.m) imposes on every fluid branch after the method switch. Under FCFS every accepted update is delivered, so this is the sojourn time of an accepted update; under preemption or replacement it is the queue time per DELIVERED update, which exceeds the sojourn QN / accept of an accepted one (2026-11-14: a branch value of QN / accept was overwritten by the analyzer anyway). The source row of TN is the offered arrival rate.

Definition in file fluid_aoi.h.