4 % @brief Approximate Queue Length (AQL) algorithm
for product-form networks.
8function [XN,QN,UN,RN,numIters,AN]=pfqn_aql(L,N,Z,TOL,MAXITER,QN0)
11 % @brief Approximate Queue Length (AQL) algorithm
for product-form networks.
12 % @fn pfqn_aql(L, N, Z, TOL, MAXITER, QN0)
13 % @param L Service demand matrix.
14 % @param N Population vector.
15 % @param Z Think time vector.
16 % @param TOL Tolerance
for convergence.
17 % @param MAXITER Maximum number of iterations.
18 % @param QN0 Initial guess
for queue lengths.
19 % @
return XN System throughput.
20 % @
return QN Mean queue lengths.
21 % @
return UN Utilization.
22 % @
return RN Residence times.
23 % @
return numIters Number of iterations.
24 % @
return AN Average arrival rate at
nodes.
31if nargin<6 || isempty(QN0) %~exist(
'QN',
'var')
32 QN0 = repmat(N,M,1)/M;
34 QN0 = QN0+eps; % 0 gives problems
61 R{t+1}(k,s) = L(k,s)*(1+(sum(n)-1)*(Q{t+1}(k)/sum(n)-gamma(k,s)));
65 X{t+1}(s) = n(s)/(Z(s)+sum(R{t+1}(:,s)));
68 Q{t+1}(k) = X{t+1}(:)
'*R{t+1}(k,:)';
73 gamma(k,s) = (Q{0+1}(k)/sum(N)) - (Q{s+1}(k)/(sum(N)-1));
76 if max(abs((Q_olditer{1}(:)-Q{1}(:))./Q{1}(:))) < TOL || it == MAXITER
85 UN(k,s) = XN(s)*L(k,s);
86 QN(k,s) = UN(k,s)*(1+Q{s+1}(k));