1%{ @file qbd_depproc_etaqa_ps.m
2 % @brief Constructs MAP departure process
for MAP/MAP/1-PS via ETAQA truncation
4 % @author LINE Development Team
8 % @brief Builds a MAP approximation of the departure process
for a MAP/MAP/1 PS queue
11 % This function constructs a finite-state MAP {D0, D1} representation of the
12 % departure process from a MAP/MAP/1 queue with Processor Sharing (PS)
13 % discipline,
using ETAQA truncation at QBD level n.
15 % Compared to the FCFS variant (qbd_depproc_etaqa), the PS discipline splits
16 % service completions at level j into a departure component B*(1/j) and an
17 % internal transition component B*(1-1/j), reflecting the rate-dependent
18 % sharing of the server among j jobs. The tail approximation at level n uses
19 % Bbar and Bhat matrices weighted by 1/n and (n-1)/n respectively.
23 % D = qbd_depproc_etaqa_ps(MAPa, MAPs, n)
28 % <tr><th>Name<th>Description
29 % <tr><td>MAPa<td>Arrival process in MAP format {D0, D1}
30 % <tr><td>MAPs<td>Service process in MAP format {D0, D1}
31 % <tr><td>n<td>Truncation level (number of QBD levels to represent explicitly)
36 % <tr><th>Name<th>Description
37 % <tr><td>D<td>Departure process in MAP format {D0, D1}
40function [D]=qbd_depproc_etaqa_ps(MAPa,MAPs,n)
46F = kron(MAPa{2},eye(ns));
47L = krons(MAPa{1},MAPs{1});
48B = kron(eye(na),MAPs{2});
49L0 = kron(MAPa{1},eye(ns));
51[~,R,~] = QBD_CR(B,L,F);
58vn = zeros(1,n); vn(end)=1;
60D0=kron(diag([1,vn1]),L)+kron(diag(vn1,1),F);
61D0=[zeros(size(L0,1),size(D0,2)); D0];
62D0 = [zeros(size(D0,1),size(B,2)),D0];
63D0(1:size(L0,1),1:(size(L0,2)+size(F,2)))=[L0,F];
64D0(((n-1)*lvlsz+1):n*lvlsz,((n-1)*lvlsz+1):n*lvlsz)=Lhat;
66D0 = D0 + kron(diag(vn,-1),Bbar)+kron(diag([0,vn]),Bhat)*(n-1)/n;
67D1=kron(diag(vn,-1),Bbar)+kron(diag([0,vn]),Bhat)/n;
69 D0((j*lvlsz+1):(j+1)*lvlsz, ((j-1)*lvlsz+1):j*lvlsz)=B*(1-1/j);
70 D1((j*lvlsz+1):(j+1)*lvlsz, ((j-1)*lvlsz+1):j*lvlsz)=B*(1/j);