1function [meanAoI, varAoI, peakAoI] = aoi_fcfs_md1(lambda, d)
2%AOI_FCFS_MD1 Mean, variance, and peak AoI
for M/D/1 FCFS queue
4% [meanAoI, varAoI, peakAoI] = aoi_fcfs_md1(lambda, d)
6% Computes the Age of Information metrics
for an M/D/1 queue with
7% First-Come First-Served (FCFS) discipline.
9% M/D/1: Poisson arrivals with rate lambda, deterministic service time d.
12% lambda (
double): Arrival rate (Poisson arrivals)
13% d (double): Deterministic service time
16% meanAoI (double): Mean (average) Age of Information
17% varAoI (double): Variance of Age of Information
18% peakAoI (double): Mean Peak Age of Information
20% Formulas (from Inoue et al., IEEE Trans. IT, 2019):
21% Uses M/GI/1 FCFS results with deterministic service.
23% E[H] = d, E[H^2] = d^2 (deterministic)
25% E[W] = lambda * d^2 / (2*(1-rho)) (Pollaczek-Khinchine)
27% E[A] = E[Y] + E[T] + lambda*E[H^2]/(2*(1-rho))
28% = 1/lambda + E[W] + d + lambda*d^2/(2*(1-rho))
31% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka,
"A General Formula for
32% the Stationary Distribution of the Age of Information and Its
33% Application to Single-Server Queues," IEEE Trans. Information Theory,
34% vol. 65, no. 12, pp. 8305-8324, 2019.
36% See also: aoi_fcfs_mm1, aoi_fcfs_mgi1, aoi_lcfspr_md1
38% Copyright (c) 2012-2026, Imperial College London
43 line_error(mfilename,
'Arrival rate lambda must be positive');
46 line_error(mfilename,
'Service time d must be positive');
54 line_error(mfilename,
'System unstable: rho = lambda*d = %.4f >= 1', rho);
57% Service time moments (deterministic)
61% Mean waiting time (Pollaczek-Khinchine
for M/G/1)
62% E[W] = lambda * E[H^2] / (2 * (1 - rho))
63E_W = lambda * E_H2 / (2 * (1 - rho));
65% Mean system time (sojourn time)
68% Mean interarrival time
71% Mean AoI
for M/G/1 FCFS (Proposition 1)
72% E[A] = E[Y] + E[T] + lambda * E[H^2] / (2*(1-rho))
73% = 1/lambda + E[W] + d + lambda*d^2/(2*(1-rho))
74% = 1/lambda + d + lambda*d^2/(1-rho) [since E[W] uses same term]
75meanAoI = E_Y + E_T + lambda * E_H2 / (2 * (1 - rho));
78% E[Apeak] = E[T] + E[Y]
82% For M/D/1, the variance depends on the second moment of AoI.
83% Using the general M/G/1 result with deterministic service:
84% Var[A] can be computed from LST derivatives, but
for deterministic
86% Var[Y] = 1/lambda^2 (exponential interarrival)
87% Var[H] = 0 (deterministic service)
89% A simpler approximation
for variance:
90% For now, compute
using the relationship with second moments
91% This
is an approximation; exact formula
requires LST analysis
92E_Y2 = 2 / lambda^2; % Second moment of exponential
93E_T2 = E_H2 + 2*E_H*E_W + E_W^2 + lambda * E_H2 / (1 - rho); % Approx
95% Use relationship: E[A^2] approx from paper results
96% For deterministic service, variance
is lower than exponential
case
97varAoI = E_Y2 - E_Y^2 + 2*E_W*E_H / (1-rho) + E_H2 * rho / (1-rho)^2;
99% Ensure non-negative variance (numerical safety)