LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfsd_gim1.m
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
3%
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfsd_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 Discarding (LCFS-D) discipline.
8%
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
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_lcfss_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;
55
56% Find sigma: probability arriving customer finds server busy
57sigma_func = @(sig) Y_lst(mu - mu * sig) - sig;
58try
59 sigma = fzero(sigma_func, [0.001, 0.999]);
60catch
61 sigma = rho; % Fallback
62end
63
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)
67%
68% The effective service time is S + (residual service if busy)
69
70% Probability arriving update finds server busy: sigma
71% When busy, expected remaining service = 1/mu (memoryless)
72
73% Mean effective system time
74E_T_eff = E_S + sigma * E_S;
75
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);
79
80% Mean Peak AoI
81peakAoI = E_Y + E_T_eff;
82
83% LST is complex for LCFS-D; return empty handle
84lstAoI = [];
85
86end