1function [AoI_g,AoI_A,AoI_h,AoI_mean,AoI_var,PAoI_g,PAoI_A,PAoI_h,PAoI_mean,PAoI_var]=solveBufferless(tau,T,sigma,S,p)
2% solveBufferless calculates parameters
for the distributions of AoI and
3% pAoI and their first and second moments with the means of MFQ
for bufferless systems.
5% Original source: aoi-fluid toolbox
6% Copyright (c) 2020, Ozancan Dogan, Nail Akar, Eray Unsal Atay
9% Integrated into LINE solver
for Age of Information analysis.
12% tau,T : infitesimal generator and initial probability vector
13% of the arrival process
14% sigma,S : infitesimal generator and initial probability vector
15% of the service process
16% p : packet preemption probability
19% AoI_g,AoI_A,AoI_h : matrix exponential parameters of AoI
20% PAoI_g,PAoI_A,PAoI_h : matrix exponential parameters of pAoI
21% AoI_mean,AoI_var : mean and variance of AoI
22% PAoI_mean,PAoI_var : mean and variance of pAoI
24k = size(T,2); % size of the arrival matrix
25l = size(S,2); % size of the service matrix
28z = 2*k*l+k+1; % z
is the system size
29a = 1; % a
is the number of negative drift states
30b = z-1; % b
is the number of positive drift states
31% construction of the matrix Q in Eqn (13)
32Q11 = kron(eye(k),S) + kron(T, eye(l)) + (1-p)*kron(kron(kappa,tau),eye(l));
33Q33 = Q11 + p*kron(kappa,kron(ones(l,1),kron(tau,sigma)));
34Q = [Q11,kron(eye(k), nu),zeros(k*l,k*l),p*kron(kappa,ones(l,1)); ...
35 zeros(k,k*l),T,kron(kappa,kron(tau,sigma)),zeros(k,1);...
36 zeros(k*l,k*l),zeros(k*l,k),Q33,kron(ones(k,1),nu);
38% construction of the drift matrix R in Eqn (13)
41% Qtilde Construction in Eqn (13)
43Qtilde(z,1:k*l) = kron(tau,sigma);
45% construction of the orthogonal matrix
P in Line 2 of Alg. 1
50P = eye(z)-(2*(u)*(u'))/(u'*u);
51% construction of the matrices A, H, and Qtildestar in Line 3 of Alg. 1
55Qtildestar = Qtilde(b+1:z,1:z);
56%solve for the vectors g and d in Line 4 of Alg. 1
57EqnMatrix = [H*R,-inv(A)*H*ones(z,1);-Qtildestar ones(a,1)];
58RightHandSide = [zeros(1,z) 1];
59Solution = mldivide(EqnMatrix',RightHandSide')';
62% We now have the ME representation in Eqn (8) for the MFQ X(t)
63% For AoI, restrict to states in Phases 2 and 3 only
64SelectedStates = [zeros(k*l,1);ones(k*l+k,1);0];
65AoI_h = H*SelectedStates;
66NormConstant = -g/A*AoI_h;
67AoI_g = g/NormConstant;
69% now we have the general form in Eqn (4)for the AoI distribution
70AoI_mean = AoI_g/(AoI_A^2)*AoI_h; % the moment expressions in Eqn (4)
71AoI_var = -2*AoI_g/(AoI_A^3)*AoI_h-AoI_mean^2;
72% For PAoI, restrict to states in Phase 3 scaled suitably by the entries of nu
73SelectedStates = [zeros(k*l+k,1);kron(ones(k,1),nu);0];
74PAoI_h = H*SelectedStates;
75NormConstant = -g/A*PAoI_h;
76PAoI_g = g/NormConstant;
78% now we have the general form in Eqn (4)for the AoI distribution
79PAoI_mean = PAoI_g/(PAoI_A^2)*PAoI_h; % the moment expressions again in Eqn (4)
80PAoI_var = -2*PAoI_g/(PAoI_A^3)*PAoI_h-PAoI_mean^2;