1function [meanAoI, lstAoI, peakAoI] = aoi_lcfspr_gim1(Y_lst, mu, E_Y, E_Y2)
2%AOI_LCFSPR_GIM1 Mean AoI and LST
for GI/M/1 preemptive LCFS queue
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfspr_gim1(Y_lst, mu, E_Y, E_Y2)
6% Computes the Age of Information metrics
for a GI/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). This ensures the freshest update
is always served.
13% Y_lst (function_handle): LST of interarrival time, @(s) -> complex
14% mu (double): Service rate (exponential service)
15% E_Y (double): Mean interarrival time (first moment)
16% E_Y2 (double): Second moment of interarrival time (for reference)
19% meanAoI (double): Mean (average) Age of Information
20% lstAoI (function_handle): LST of AoI distribution
21% peakAoI (double): Mean Peak Age of Information
23% Formulas (from Inoue et al., IEEE Trans. IT, 2019, Section IV):
24% For preemptive LCFS, the AoI simplifies significantly:
25% E[A] = E[Y] + E[S] = E[Y] + 1/mu
26% E[Apeak] = E[Y] + 1/mu
28% LST of AoI: A*(s) = Y*(s) * (mu / (s + mu))
29% This
is the product of interarrival LST and exponential service LST.
32% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka,
"A General Formula for
33% the Stationary Distribution of the Age of Information and Its
34% Application to Single-Server Queues," IEEE Trans. Information Theory,
35% vol. 65, no. 12, pp. 8305-8324, 2019.
37% See also: aoi_fcfs_gim1, aoi_lcfspr_mm1, aoi_lcfspr_mgi1
39% Copyright (c) 2012-2026, Imperial College London
44 line_error(mfilename,
'Service rate mu must be positive');
47 line_error(mfilename,
'Mean interarrival time E_Y must be positive');
55 line_error(mfilename,
'System unstable: rho = 1/(E_Y*mu) = %.4f >= 1', rho);
61% Mean AoI
for preemptive LCFS (Proposition 4)
65% Mean Peak AoI (same as mean AoI
for preemptive LCFS)
68% LST of AoI
for preemptive LCFS
69% A*(s) = Y*(s) * (mu / (s + mu))
70% This
is the product of interarrival LST and exponential service LST
71lstAoI = @(s) Y_lst(s) .* (mu ./ (s + mu));