LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfspr_md1.m
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
3%
4% [meanAoI, varAoI, peakAoI] = aoi_lcfspr_md1(lambda, d)
5%
6% Computes the Age of Information metrics for an M/D/1 queue with
7% preemptive Last-Come First-Served (LCFS-PR) discipline.
8%
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.
12%
13% Parameters:
14% lambda (double): Arrival rate (Poisson arrivals)
15% d (double): Deterministic service time
16%
17% Returns:
18% meanAoI (double): Mean (average) Age of Information
19% varAoI (double): Variance of Age of Information
20% peakAoI (double): Mean Peak Age of Information
21%
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.
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_md1, aoi_lcfspr_mm1, aoi_lcfspr_mgi1
34
35% Copyright (c) 2012-2026, Imperial College London
36% All rights reserved.
37
38% Validate inputs
39if lambda <= 0
40 line_error(mfilename, 'Arrival rate lambda must be positive');
41end
42if d <= 0
43 line_error(mfilename, 'Service time d must be positive');
44end
45
46% Compute utilization (for reference, but preemptive LCFS is always stable)
47rho = lambda * d;
48
49% Check stability (rho < 1 is still required for meaningful analysis)
50if rho >= 1
51 line_error(mfilename, 'System unstable: rho = lambda*d = %.4f >= 1', rho);
52end
53
54% For preemptive LCFS, the AoI is determined by the interarrival time
55% plus the service time of the successful update.
56%
57% Mean interarrival time
58E_Y = 1 / lambda;
59
60% Mean service time (deterministic)
61E_S = d;
62
63% Mean AoI for preemptive LCFS (Proposition 3 / Section IV)
64% E[A] = E[Y] + E[S]
65% For M/D/1-PR: E[A] = 1/lambda + d
66meanAoI = E_Y + E_S;
67
68% Mean Peak AoI (same formula for preemptive LCFS)
69% E[Apeak] = E[Y] + E[S]
70peakAoI = E_Y + E_S;
71
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)
76varAoI = 1 / lambda^2;
77
78end