3 % @file pfqn_linearizermx.m
4 % @brief Linearizer
for mixed open/closed queueing networks.
10 % @brief Linearizer
for mixed open/closed queueing networks.
11 % @fn pfqn_linearizermx(lambda, L, N, Z, nservers, type, tol, maxiter, method)
12 % @param lambda Arrival rate vector (inf
for closed
classes).
13 % @param L Service demand matrix.
14 % @param N Population vector (inf
for open
classes).
15 % @param Z Think time vector.
16 % @param nservers Number of servers per station.
17 % @param type Scheduling strategy per station.
18 % @param tol Convergence tolerance (
default: 1e-8).
19 % @param maxiter Maximum iterations (default: 1000).
20 % @param method Linearizer variant (
'lin',
'gflin',
'egflin', default:
'egflin').
21 % @return QN Mean queue lengths.
22 % @return UN Utilization.
23 % @return WN Waiting times.
24 % @return CN Cycle times.
25 % @return XN System throughput.
26 % @return totiter Total iterations.
29function [QN,UN,WN,CN,XN,totiter] = pfqn_linearizermx(lambda,L,N,Z,nservers,type,tol,maxiter,method)
30% function [Q,U,W,C,X,totiter] = PFQN_LINEARIZERMX(lambda,L,N,Z,nservers,type,tol,maxiter,method)
42if any(N(lambda>0)>0 & isfinite(N(lambda>0)))
43 line_error(mfilename,'Arrival rate cannot be specified on closed
classes.');
47if nargin<6 || isempty(type)
48 type = ones(M,1)*SchedStrategy.PS;
51lambda(isnan(lambda))= 0;
54openClasses = find(isinf(N));
55closedClasses = setdiff(1:length(N), openClasses);
64 UN(ist,r) = lambda(r)*L(ist,r);
76Dc = L(:,closedClasses) ./ (1-repmat(UNt,1,length((closedClasses))));
80 case {
'default',
'lin'}
81 [QNc,UNc,WNc,CNc,XNc,totiter] = pfqn_linearizer(Dc,N(closedClasses),Z(closedClasses),type,tol,maxiter);
84 [QNc,UNc,WNc,CNc,XNc,totiter] = pfqn_gflinearizer(Dc,N(closedClasses),Z(closedClasses),type,tol,maxiter,linAlpha);
88 alphaM(r) = 0.6 + 1.4 * exp(-8 * exp(-0.8 * N(r)));
90 [QNc,UNc,WNc,CNc,XNc,totiter] = pfqn_egflinearizer(Dc,N(closedClasses),Z(closedClasses),type,tol,maxiter,alphaM);
92 [QNc,UNc,WNc,CNc,XNc,totiter] = pfqn_linearizer(Dc,N(closedClasses),Z(closedClasses),type,tol,maxiter);
95 [QNc,UNc,WNc,CNc,XNc,totiter] = pfqn_linearizerms(Dc,N(closedClasses),Z(closedClasses),nservers,type,tol,maxiter);
98XN(closedClasses) = XNc;
99QN(:,closedClasses) = QNc;
100WN(:,closedClasses) = WNc;
101UN(:,closedClasses) = UNc;
102CN(closedClasses) = CNc;
106 UN(ist,r) = XN(r)*L(ist,r);
112 WN(ist,r) = L(ist,r) / (1-UNt(ist));
114 WN(ist,r) = L(ist,r) * (1+sum(QNc(ist,:))) / (1-UNt(ist));
116 QN(ist,r) = WN(ist,r) * XN(r);
119CN(openClasses) = sum(WN(:,openClasses),1);