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

MAP to PH conversion for the age-of-information solvers. More...

#include <cstddef>
#include <vector>
#include "line/api/mam/map_moment.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for aoi_dist2ph.h:

Go to the source code of this file.

Classes

struct  line::aoi::AoiPh< T >
 The (alpha, T) PH pair produced by aoi_dist2ph. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::aoi

Functions

template<class T>
AoiPh< T > line::aoi::aoi_dist2ph (const Matrix< T > &D0, const Matrix< T > &D1)
 Convert a MAP (D0, D1) into the PH pair (alpha, T).
template<class T>
AoiPh< T > line::aoi::aoi_dist2ph (const mam::Map< T > &m)
 Convenience overload taking the MAP as line::mam::Map.

Detailed Description

MAP to PH conversion for the age-of-information solvers.

Templated port of matlab/src/api/aoi/aoi_dist2ph.m. The (D0, D1) pair of a MAP is turned into the (alpha, T) pair the aoi_* algorithms consume:

T = D0, the sub-generator, unchanged theta solves theta (D0 + D1) = 0, sum theta = 1 alpha = theta D1 / (theta D1 e), i.e. map_pie, the phase distribution just after a completion

Until 2026-11-14 every codebase used theta .* (D1 e) normalized, which is the phase in which a completion HAPPENS (the exit phase), not the one the next service starts in. For an Erlang-2 of mean 1 that gave alpha = [0 1] and a PH of mean 0.5, which then fed every AoI solver through aoi_extract_params.

ARITHMETIC. One linear solve, one normalization and sign checks, so this is exact at T = Rational and is instantiated there. MATLAB obtains theta from the overdetermined [Q'; e'] \ [0; 1], which its backslash resolves by QR; on a consistent system that is the exact solution, and the port reaches the same solution through the normal equations, which is a square solve the templated LU can carry exactly.

The generator repair of the reference is kept: when the rows of D0 + D1 do not sum to zero to within 1e-10, the diagonal is corrected so that they do. That test is a comparison against a constant and needs no transcendental function, so it carries over verbatim to the exact instantiation, where it is essentially never triggered.

Definition in file aoi_dist2ph.h.