LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfss_gim1.m
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
3%
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfss_gim1(Y_lst, mu, E_Y, E_Y2)
5%
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.
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% 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
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% Reference:
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.
30%
31% See also: aoi_lcfsd_gim1, aoi_fcfs_gim1, aoi_lcfspr_gim1
32
33% Copyright (c) 2012-2026, Imperial College London
34% All rights reserved.
35
36% Validate inputs
37if mu <= 0
38 line_error(mfilename, 'Service rate mu must be positive');
39end
40if E_Y <= 0
41 line_error(mfilename, 'Mean interarrival time E_Y must be positive');
42end
43
44% Compute utilization
45lambda = 1 / E_Y;
46rho = lambda / mu;
47
48% Check stability
49if rho >= 1
50 line_error(mfilename, 'System unstable: rho = 1/(E_Y*mu) = %.4f >= 1', rho);
51end
52
53% Mean service time
54E_S = 1 / mu;
55E_S2 = 2 / mu^2; % Second moment of exponential
56
57% Find sigma: probability arriving customer finds server busy
58sigma_func = @(sig) Y_lst(mu - mu * sig) - sig;
59try
60 sigma = fzero(sigma_func, [0.001, 0.999]);
61catch
62 sigma = rho; % Fallback
63end
64
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.
67%
68% Mean system delay
69E_D = 1 / (mu * (1 - sigma));
70
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;
74
75% Mean Peak AoI
76peakAoI = E_Y + E_D;
77
78% LST is complex for LCFS-S; return empty handle
79lstAoI = [];
80
81end