1function [meanAoI, lstAoI, peakAoI] = aoi_lcfsd_gim1(Y_lst, mu, E_Y, E_Y2)
2%AOI_LCFSD_GIM1 Mean AoI
for GI/M/1 non-preemptive LCFS-D queue
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfsd_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 Discarding (LCFS-D) discipline.
9% In LCFS-D, when a
new update arrives
while the server
is busy:
10% - If there
's an update waiting in queue, it is discarded
11% - The new update takes its place in the queue
12% - When service completes, the waiting update (if any) is served
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_lcfss_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);
56% Find sigma: probability arriving customer finds server busy
57sigma_func = @(sig) Y_lst(mu - mu * sig) - sig;
59 sigma = fzero(sigma_func, [0.001, 0.999]);
61 sigma = rho; % Fallback
64% For GI/M/1 LCFS-D (also GI/M/1/2*), when an update arrives:
65% - If server idle: enters service immediately
66% - If server busy: waits (discarding any previous waiting update)
68% The effective service time
is S + (residual service
if busy)
70% Probability arriving update finds server busy: sigma
71% When busy, expected remaining service = 1/mu (memoryless)
73% Mean effective system time
74E_T_eff = E_S + sigma * E_S;
76% Mean AoI
for LCFS-D (from Section VI analysis adapted
for GI/M/1)
77% E[A] = E[Y] + E[T_eff] + additional term
for waiting
78meanAoI = E_Y + E_S * (1 + sigma) + sigma * E_S / (1 + sigma);
81peakAoI = E_Y + E_T_eff;
83% LST
is complex
for LCFS-D;
return empty handle