1function [meanAoI, varAoI, peakAoI] = aoi_lcfspr_dm1(tau, mu)
2%AOI_LCFSPR_DM1 Mean, variance, and peak AoI
for D/M/1 preemptive LCFS queue
4% [meanAoI, varAoI, peakAoI] = aoi_lcfspr_dm1(tau, mu)
6% Computes the Age of Information metrics
for a D/M/1 queue with
7% preemptive Last-Come First-Served (LCFS-PR) discipline.
9% In LCFS-PR, when a
new update arrives, it preempts the current update
10% in service (
if any). For D/M/1, arrivals are deterministic (every tau
11% time units) and service
is exponential with rate mu.
14% tau (
double): Deterministic interarrival time
15% mu (double): Service rate (exponential service)
18% meanAoI (double): Mean (average) Age of Information
19% varAoI (double): Variance of Age of Information
20% peakAoI (double): Mean Peak Age of Information
22% Formulas (from Inoue et al., IEEE Trans. IT, 2019, Section IV):
23% For preemptive LCFS with GI/M/1:
24% E[A] = E[Y] + E[S] = tau + 1/mu
25% where S
is the service time (exponential).
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.
33% See also: aoi_fcfs_dm1, aoi_lcfspr_mm1, aoi_lcfspr_gim1
35% Copyright (c) 2012-2026, Imperial College London
40 line_error(mfilename,
'Interarrival time tau must be positive');
43 line_error(mfilename,
'Service rate mu must be positive');
50% Check stability (rho < 1
is required)
52 line_error(mfilename,
'System unstable: rho = 1/(tau*mu) = %.4f >= 1', rho);
55% For preemptive LCFS, the AoI
is determined by the interarrival time
56% plus the service time of the successful update.
58% Mean interarrival time (deterministic)
61% Mean service time (exponential)
64% Mean AoI
for preemptive LCFS (Proposition 4 / Section IV)
66% For D/M/1-PR: E[A] = tau + 1/mu
69% Mean Peak AoI (same formula
for preemptive LCFS)
70% E[Apeak] = E[Y] + E[S]
73% Variance of AoI
for preemptive LCFS
74% Var[A] = Var[Y] + Var[S]
75% Since Y
is deterministic, Var[Y] = 0
76% Var[S] = 1/mu^2 (exponential)