LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
aoi_lcfspr_mgi1.m
1function [meanAoI, lstAoI, peakAoI] = aoi_lcfspr_mgi1(lambda, H_lst, E_H, E_H2)
2%AOI_LCFSPR_MGI1 Mean AoI and LST for M/GI/1 preemptive LCFS queue
3%
4% [meanAoI, lstAoI, peakAoI] = aoi_lcfspr_mgi1(lambda, H_lst, E_H, E_H2)
5%
6% Computes the Age of Information metrics for an M/GI/1 queue with
7% preemptive Last-Come First-Served (LCFS-PR) discipline.
8%
9% In LCFS-PR, when a new update arrives, it preempts the current update
10% in service (if any). This ensures the freshest update is always served.
11%
12% Parameters:
13% lambda (double): Arrival rate (Poisson arrivals)
14% H_lst (function_handle): LST of service time, @(s) -> complex
15% E_H (double): Mean service time (first moment)
16% E_H2 (double): Second moment of service time (for reference)
17%
18% Returns:
19% meanAoI (double): Mean (average) Age of Information
20% lstAoI (function_handle): LST of AoI distribution
21% peakAoI (double): Mean Peak Age of Information
22%
23% Formulas (from Inoue et al., IEEE Trans. IT, 2019, Section IV):
24% For preemptive LCFS, the AoI simplifies significantly:
25% E[A] = E[Y] + E[H] = 1/lambda + E[H]
26% E[Apeak] = E[Y] + E[H]
27%
28% LST of AoI: A*(s) = (lambda/(s+lambda)) * H*(s)
29% This is the convolution of exponential interarrival and service time.
30%
31% Reference:
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.
36%
37% See also: aoi_fcfs_mgi1, aoi_lcfspr_mm1, aoi_lcfspr_gim1
38
39% Copyright (c) 2012-2026, Imperial College London
40% All rights reserved.
41
42% Validate inputs
43if lambda <= 0
44 line_error(mfilename, 'Arrival rate lambda must be positive');
45end
46if E_H <= 0
47 line_error(mfilename, 'Mean service time E_H must be positive');
48end
49
50% Compute utilization (for reference; preemptive LCFS still requires rho < 1)
51rho = lambda * E_H;
52
53if rho >= 1
54 line_error(mfilename, 'System unstable: rho = lambda*E_H = %.4f >= 1', rho);
55end
56
57% Mean interarrival time
58E_Y = 1 / lambda;
59
60% Mean AoI for preemptive LCFS (Proposition 3)
61% E[A] = E[Y] + E[H]
62meanAoI = E_Y + E_H;
63
64% Mean Peak AoI (same as mean AoI for preemptive LCFS)
65peakAoI = E_Y + E_H;
66
67% LST of AoI for preemptive LCFS
68% A*(s) = (lambda / (s + lambda)) * H*(s)
69% This is the product of exponential interarrival LST and service LST
70lstAoI = @(s) (lambda ./ (s + lambda)) .* H_lst(s);
71
72end