LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_fcfs_dm1.m
1function [meanAoI, varAoI, peakAoI] = aoi_fcfs_dm1(tau, mu)
2%AOI_FCFS_DM1 Mean, variance, and peak AoI for D/M/1 FCFS queue
3%
4% [meanAoI, varAoI, peakAoI] = aoi_fcfs_dm1(tau, mu)
5%
6% Computes the Age of Information metrics for a D/M/1 queue with
7% First-Come First-Served (FCFS) discipline.
8%
9% D/M/1: Deterministic arrivals with interarrival time tau (rate 1/tau),
10% exponential service with rate mu.
11%
13% tau (double): Deterministic interarrival time
14% mu (double): Service rate (exponential service)
15%
16% Returns:
17% meanAoI (double): Mean (average) Age of Information
18% varAoI (double): Variance of Age of Information
19% peakAoI (double): Mean Peak Age of Information
20%
21% Formulas (from Inoue et al., IEEE Trans. IT, 2019):
22% Uses GI/M/1 FCFS results with deterministic arrivals.
23% For D/M/1, the key parameter is sigma, the root of:
24% sigma = exp(-mu*tau*(1-sigma))
25% which gives the probability an arriving customer finds system non-empty.
26%
27% Reference:
28% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka, "A General Formula for
29% the Stationary Distribution of the Age of Information and Its
30% Application to Single-Server Queues," IEEE Trans. Information Theory,
31% vol. 65, no. 12, pp. 8305-8324, 2019.
32%
33% See also: aoi_fcfs_mm1, aoi_fcfs_gim1, aoi_lcfspr_dm1
34
35% Copyright (c) 2012-2026, Imperial College London
36% All rights reserved.
37
38% Validate inputs
39if tau <= 0
40 line_error(mfilename, 'Interarrival time tau must be positive');
41end
42if mu <= 0
43 line_error(mfilename, 'Service rate mu must be positive');
44end
45
46% Compute utilization
47% For D/M/1: lambda = 1/tau, so rho = 1/(tau*mu)
48lambda = 1 / tau;
49rho = lambda / mu;
50
51% Check stability
52if rho >= 1
53 line_error(mfilename, 'System unstable: rho = 1/(tau*mu) = %.4f >= 1', rho);
54end
55
56% Compute sigma: unique root in (0,1) of sigma = exp(-mu*tau*(1-sigma))
57% This is the probability an arriving customer finds the server busy
58% Use fixed-point iteration or fzero
59sigma_func = @(s) exp(-mu * tau * (1 - s)) - s;
60sigma = fzero(sigma_func, [0.001, 0.999]);
61
62% For GI/M/1, the system delay (waiting + service) has LST:
63% D*(s) = (1-sigma)*mu / (mu - s) for s < mu
64% E[D] = 1/mu + sigma/(mu*(1-sigma)) = 1/(mu*(1-sigma))
65
66E_D = 1 / (mu * (1 - sigma));
67
68% Mean interarrival time (deterministic)
69E_Y = tau;
70
71% Mean AoI for D/M/1 FCFS (exact)
72% With deterministic interarrivals Y = tau the interarrival/system-time
73% correlation term vanishes, so E[A] = E[Y^2]/(2*E[Y]) + E[D]
74% = tau/2 + 1/(mu*(1-sigma)) (validated against simulation)
75meanAoI = tau / 2 + E_D;
76
77% Mean Peak AoI
78% E[Apeak] = E[Y] + E[D] = tau + 1/(mu*(1-sigma))
79peakAoI = tau + E_D;
80
81% Variance of AoI
82% For D/M/1, the variance depends on the system delay variance and
83% the deterministic interarrival (which contributes 0 variance).
84% E[D^2] = 2/(mu*(1-sigma))^2 for exponential service with GI/M/1 structure
85E_D2 = 2 / (mu * (1 - sigma))^2;
86Var_D = E_D2 - E_D^2;
87
88% Var[Y] = 0 (deterministic)
89% Approximate variance of AoI (needs exact formula from paper)
90varAoI = Var_D + (sigma / (mu * (1-sigma)))^2;
91
92% Ensure non-negative variance (numerical safety)
93if varAoI < 0
94 varAoI = 0;
95end
96
97end
Definition Station.m:245