LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfss_mgi1.m
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
3%
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfss_mgi1(lambda, H_lst, E_H, E_H2)
5%
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.
8%
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")
13%
14% Parameters:
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
19%
20% Returns:
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
24%
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.
28%
29% Reference:
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.
34%
35% See also: aoi_lcfsd_mgi1, aoi_fcfs_mgi1, aoi_lcfspr_mgi1
36
37% Copyright (c) 2012-2026, Imperial College London
38% All rights reserved.
39
40% Validate inputs
41if lambda <= 0
42 line_error(mfilename, 'Arrival rate lambda must be positive');
43end
44if E_H <= 0
45 line_error(mfilename, 'Mean service time E_H must be positive');
46end
47if E_H2 < E_H^2
48 line_error(mfilename, 'Second moment E_H2 must be >= E_H^2');
49end
50
51% Compute utilization
52rho = lambda * E_H;
53
54% Check stability
55if rho >= 1
56 line_error(mfilename, 'System unstable: rho = lambda*E_H = %.4f >= 1', rho);
57end
58
59% Mean interarrival time
60E_Y = 1 / lambda;
61
62% see _kb/03-api-layer.md (AoI family) for the Inoue et al. 2019 derivation
63
64E_B = E_H / (1 - rho);
65E_B2 = E_H2 / (1 - rho)^3;
66
67% Mean AoI for LCFS-S (Proposition 5, simplified form)
68% E[A] = E[Y] + E[H] + (1 - rho) * lambda * E[B^2] / 2
69% = 1/lambda + E[H] + (1 - rho) * lambda * E[H^2] / (2 * (1 - rho)^3)
70% = 1/lambda + E[H] + lambda * E[H^2] / (2 * (1 - rho)^2)
71
72meanAoI = E_Y + E_H + lambda * E_H2 / (2 * (1 - rho)^2);
73
74% Mean Peak AoI
75% For LCFS-S, peak AoI involves the residual busy period
76peakAoI = E_Y + E_H + lambda * E_B2 / (2 * E_B);
77
78% LST is complex for LCFS-S; return empty handle
79lstAoI = [];
80
81end