1function [meanAoI, lstAoI, peakAoI] = aoi_lcfss_gim1(Y_lst, mu, E_Y, E_Y2)
2%AOI_LCFSS_GIM1 Mean AoI
for GI/M/1 non-preemptive LCFS-S queue
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfss_gim1(Y_lst, mu, E_Y, E_Y2)
6% Computes the Age of Information metrics
for a GI/M/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% Y_lst (function_handle): LST of interarrival time, @(s) -> complex
16% mu (double): Service rate (exponential service)
17% E_Y (double): Mean interarrival time (first moment)
18% E_Y2 (double): Second moment of interarrival 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
26% Y. Inoue, H. Masuyama, T. Takine, T. Tanaka,
"A General Formula for
27% the Stationary Distribution of the Age of Information and Its
28% Application to Single-Server Queues," IEEE Trans. Information Theory,
29% vol. 65, no. 12, pp. 8305-8324, 2019.
31% See also: aoi_lcfsd_gim1, aoi_fcfs_gim1, aoi_lcfspr_gim1
33% Copyright (c) 2012-2026, Imperial College London
38 line_error(mfilename,
'Service rate mu must be positive');
41 line_error(mfilename,
'Mean interarrival time E_Y must be positive');
50 line_error(mfilename,
'System unstable: rho = 1/(E_Y*mu) = %.4f >= 1', rho);
55E_S2 = 2 / mu^2; % Second moment of exponential
57% Find sigma: probability arriving customer finds server busy
58sigma_func = @(sig) Y_lst(mu - mu * sig) - sig;
60 sigma = fzero(sigma_func, [0.001, 0.999]);
62 sigma = rho; % Fallback
65% For GI/M/1 LCFS-S, the analysis
is similar to M/GI/1 but with
66% roles of arrival and service distributions swapped.
69E_D = 1 / (mu * (1 - sigma));
71% Mean AoI
for LCFS-S (from Section V analysis adapted
for GI/M/1)
72% E[A] = E[Y] + E[S] + sigma * E[D]
73meanAoI = E_Y + E_S + sigma * E_D;
78% LST
is complex
for LCFS-S;
return empty handle