LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfspr_gim1.m
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
3%
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfspr_gim1(Y_lst, mu, E_Y, E_Y2)
5%
6% Computes the Age of Information metrics for a GI/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). This ensures the freshest update is always served.
11%
12% Parameters:
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)
17%
18% Returns:
19% meanAoI (double): Mean (average) Age of Information
20% lstAoI (function_handle): LST of AoI distribution
21% peakAoI (double): Mean Peak Age of Information
22%
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
27%
28% LST of AoI: A*(s) = Y*(s) * (mu / (s + mu))
29% This is the product of interarrival LST and exponential service LST.
30%
31% Reference:
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.
36%
37% See also: aoi_fcfs_gim1, aoi_lcfspr_mm1, aoi_lcfspr_mgi1
38
39% Copyright (c) 2012-2026, Imperial College London
40% All rights reserved.
41
42% Validate inputs
43if mu <= 0
44 line_error(mfilename, 'Service rate mu must be positive');
45end
46if E_Y <= 0
47 line_error(mfilename, 'Mean interarrival time E_Y must be positive');
48end
49
50% Compute utilization
51lambda = 1 / E_Y;
52rho = lambda / mu;
53
54if rho >= 1
55 line_error(mfilename, 'System unstable: rho = 1/(E_Y*mu) = %.4f >= 1', rho);
56end
57
58% Mean service time
59E_S = 1 / mu;
60
61% Mean AoI for preemptive LCFS (Proposition 4)
62% E[A] = E[Y] + E[S]
63meanAoI = E_Y + E_S;
64
65% Mean Peak AoI (same as mean AoI for preemptive LCFS)
66peakAoI = E_Y + E_S;
67
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));
72
73end