1function [meanAoI, varAoI, peakAoI] = aoi_lcfspr_md1(lambda, d)
2%AOI_LCFSPR_MD1 Mean, variance, and peak AoI
for M/D/1 preemptive LCFS queue
4% [meanAoI, varAoI, peakAoI] = aoi_lcfspr_md1(lambda, d)
6% Computes the Age of Information metrics
for an M/D/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 M/D/1, an update
is successful
if no
new
11% arrivals occur during its deterministic service time d.
14% lambda (
double): Arrival rate (Poisson arrivals)
15% d (double): Deterministic service time
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 M/G/1:
24% E[A] = E[Y] + E[S] = 1/lambda + d
25% where S
is the (successful) service time, which equals d.
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_md1, aoi_lcfspr_mm1, aoi_lcfspr_mgi1
35% Copyright (c) 2012-2026, Imperial College London
40 line_error(mfilename,
'Arrival rate lambda must be positive');
43 line_error(mfilename,
'Service time d must be positive');
46% Compute utilization (
for reference, but preemptive LCFS
is always stable)
49% Check stability (rho < 1
is still required
for meaningful analysis)
51 line_error(mfilename,
'System unstable: rho = lambda*d = %.4f >= 1', rho);
54% For preemptive LCFS, the AoI
is determined by the interarrival time
55% plus the service time of the successful update.
57% Mean interarrival time
60% Mean service time (deterministic)
63% Mean AoI
for preemptive LCFS (Proposition 3 / Section IV)
65% For M/D/1-PR: E[A] = 1/lambda + d
68% Mean Peak AoI (same formula
for preemptive LCFS)
69% E[Apeak] = E[Y] + E[S]
72% Variance of AoI
for preemptive LCFS
73% Var[A] = Var[Y] + Var[S]
74% Since S
is deterministic, Var[S] = 0
75% Var[Y] = 1/lambda^2 (exponential)