LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfspr_dm1.m
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
3%
4% [meanAoI, varAoI, peakAoI] = aoi_lcfspr_dm1(tau, mu)
5%
6% Computes the Age of Information metrics for a D/M/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 D/M/1, arrivals are deterministic (every tau
11% time units) and service is exponential with rate mu.
12%
13% Parameters:
14% tau (double): Deterministic interarrival time
15% mu (double): Service rate (exponential service)
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 GI/M/1:
24% E[A] = E[Y] + E[S] = tau + 1/mu
25% where S is the service time (exponential).
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_dm1, aoi_lcfspr_mm1, aoi_lcfspr_gim1
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
47lambda = 1 / tau;
48rho = lambda / mu;
49
50% Check stability (rho < 1 is required)
51if rho >= 1
52 line_error(mfilename, 'System unstable: rho = 1/(tau*mu) = %.4f >= 1', rho);
53end
54
55% For preemptive LCFS, the AoI is determined by the interarrival time
56% plus the service time of the successful update.
57%
58% Mean interarrival time (deterministic)
59E_Y = tau;
60
61% Mean service time (exponential)
62E_S = 1 / mu;
63
64% Mean AoI for preemptive LCFS (Proposition 4 / Section IV)
65% E[A] = E[Y] + E[S]
66% For D/M/1-PR: E[A] = tau + 1/mu
67meanAoI = E_Y + E_S;
68
69% Mean Peak AoI (same formula for preemptive LCFS)
70% E[Apeak] = E[Y] + E[S]
71peakAoI = E_Y + E_S;
72
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)
77varAoI = 1 / mu^2;
78
79end