1function [meanAoI, lstAoI, peakAoI] = aoi_lcfss_mgi1(lambda, H_lst, E_H, E_H2)
2%AOI_LCFSS_MGI1 Mean AoI
for M/GI/1 non-preemptive LCFS-S queue
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfss_mgi1(lambda, H_lst, E_H, E_H2)
6% Computes the Age of Information metrics
for an M/GI/1 queue with
7% non-preemptive Last-Come First-Served with Set-aside (LCFS-S) discipline.
9% In LCFS-S, when a
new update arrives
while the server
is busy:
10% - The
new update waits in the queue
11% - When service completes, the most recent update in queue
is served next
12% - The older update remains in queue (
is "set aside")
15% lambda (
double): Arrival rate (Poisson arrivals)
16% H_lst (function_handle): LST of service time, @(s) -> complex
17% E_H (double): Mean service time (first moment)
18% E_H2 (double): Second moment of service time
21% meanAoI (double): Mean (average) Age of Information
22% lstAoI (function_handle): LST of AoI distribution (empty if not computed)
23% peakAoI (double): Mean Peak Age of Information
25% Formulas (from Inoue et al., IEEE Trans. IT, 2019, Section V):
26% The analysis
is more complex than FCFS or preemptive LCFS.
27% Mean AoI
is computed using the results from Theorem 6.
30% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka,
"A General Formula for
31% the Stationary Distribution of the Age of Information and Its
32% Application to Single-Server Queues," IEEE Trans. Information Theory,
33% vol. 65, no. 12, pp. 8305-8324, 2019.
35% See also: aoi_lcfsd_mgi1, aoi_fcfs_mgi1, aoi_lcfspr_mgi1
37% Copyright (c) 2012-2026, Imperial College London
42 line_error(mfilename,
'Arrival rate lambda must be positive');
45 line_error(mfilename,
'Mean service time E_H must be positive');
48 line_error(mfilename,
'Second moment E_H2 must be >= E_H^2');
56 line_error(mfilename,
'System unstable: rho = lambda*E_H = %.4f >= 1', rho);
59% Mean interarrival time
62% For LCFS-S, the mean AoI
is given by Proposition 5 in the paper.
63% The formula involves the busy period distribution of M/G/1.
66% - B: busy period of M/G/1, with LST B*(s) satisfying B*(s) = H*(s + lambda - lambda*B*(s))
67% - E[B] = E[H] / (1 - rho)
68% - E[B^2] = E[H^2] / (1 - rho)^3
71E_B2 = E_H2 / (1 - rho)^3;
73% Mean AoI
for LCFS-S (Proposition 5, simplified form)
74% E[A] = E[Y] + E[H] + (1 - rho) * lambda * E[B^2] / 2
75% = 1/lambda + E[H] + (1 - rho) * lambda * E[H^2] / (2 * (1 - rho)^3)
76% = 1/lambda + E[H] + lambda * E[H^2] / (2 * (1 - rho)^2)
78meanAoI = E_Y + E_H + lambda * E_H2 / (2 * (1 - rho)^2);
81% For LCFS-S, peak AoI involves the residual busy period
82peakAoI = E_Y + E_H + lambda * E_B2 / (2 * E_B);
84% LST
is complex
for LCFS-S;
return empty handle