1function [meanAoI, lstAoI, peakAoI] = aoi_lcfsd_mgi1(lambda, H_lst, E_H, E_H2)
2%AOI_LCFSD_MGI1 Mean AoI
for M/GI/1 non-preemptive LCFS-D queue
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfsd_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 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
14% This is also known as M/GI/1/2* (buffer size 2 with replacement).
17% lambda (double): Arrival rate (Poisson arrivals)
18% H_lst (function_handle): LST of service time, @(s) -> complex
19% E_H (double): Mean service time (first moment)
20% E_H2 (double): Second moment of service time
23% meanAoI (double): Mean (average) Age of Information
24% lstAoI (function_handle): LST of AoI distribution (empty if not computed)
25% peakAoI (double): Mean Peak Age of Information
27% Formulas (from Inoue et al., IEEE Trans. IT, 2019, Section VI):
28% The analysis uses the concept of effective service time which includes
29% potential waiting while another update is being served.
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_lcfss_mgi1, aoi_fcfs_mgi1, aoi_lcfspr_mgi1
39% Copyright (c) 2012-2026, Imperial College London
44 line_error(mfilename, 'Arrival rate lambda must be positive
');
47 line_error(mfilename, 'Mean service time E_H must be positive
');
50 line_error(mfilename, 'Second moment E_H2 must be >= E_H^2');
58 line_error(mfilename,
'System unstable: rho = lambda*E_H = %.4f >= 1', rho);
61% Mean interarrival time
64% see _kb/03-api-layer.md (AoI family)
for the Inoue et al. 2019 derivation
66E_H_residual = E_H2 / (2 * E_H); % Residual service time
67E_T_eff = E_H + rho * E_H_residual;
69% see _kb/03-api-layer.md (AoI family) -- additional discard term
is an approximation
70meanAoI = E_Y + E_H + rho * E_H2 / (2 * E_H) + rho * E_H / (1 + rho);
73% Peak AoI
is the system time plus interarrival time
74peakAoI = E_Y + E_T_eff;
76% LST
is complex
for LCFS-D;
return empty handle