4 % @brief Load-dependent MVA
for mixed open/closed networks with limited load dependence.
10 % @brief Load-dependent MVA
for mixed open/closed networks with limited load dependence.
11 % @fn pfqn_mvaldmx(lambda, D, N, Z, mu, S)
12 % @param lambda Arrival rate vector.
13 % @param D Service demand matrix.
14 % @param N Population vector.
15 % @param Z Think time vector.
16 % @param mu Load-dependent rate matrix.
17 % @param S Number of servers per station.
18 % @
return XN System throughput.
19 % @
return QN Mean queue lengths.
20 % @
return UN Utilization.
21 % @
return CN Cycle times.
22 % @
return lGN Logarithm of normalizing constant.
23 % @
return Pc Marginal queue-length probabilities.
26function [XN,QN,UN,CN,lGN,Pc] = pfqn_mvaldmx(lambda,D,N,Z,mu,S)
27% [XN,QN,UN,CN,lGN,Pc] = PFQN_MVALDMX(LAMBDA,D,N,Z,MU,S)
30 mu=ones(size(D,1),sum(N(isfinite(N))));
33if size(mu,2) < sum(N(isfinite(N)))
34 line_error(mfilename,
'MVALDMX requires to specify the load-dependent rates with one job more than the maximum closed population.');
36if any(N(find(lambda))>0 & isfinite(N(find(lambda))))
37 line_error(mfilename,
'Arrival rate cannot be specified on closed classes.');
40openClasses = find(isinf(N));
41closedClasses = setdiff(1:length(N), openClasses);
48mu(:,end+1) = mu(:,end); % we need up to sum(N)+1, but there
is limited load dep
49[EC,E,Eprime] = pfqn_mvaldmx_ec(lambda,D,mu);
50C = length(closedClasses); % number of closed
classes
51Dc = D(:,closedClasses);
54prods = zeros(1,C); % needed
for fast hashing
56 prods(r)=prod(Nc(1:r-1)+1);
58% Start at nc=(0,...,0)
61Pc = zeros(M,1+sum(Nc),prod(1+Nc));
62x = zeros(C,prod(1+Nc));
63w = zeros(M,C,prod(1+Nc));
65 Pc(ist, 1 + 0, hashpop(nvec,Nc,C,prods)) = 1.0;
70 hnvec = hashpop(nvec,Nc,C,prods);
75 hnvec_c = hashpop(oner(nvec,c),Nc,C,prods);
76 % Compute mean residence times
78 w(ist,c,hnvec) = w(ist,c,hnvec) + Dc(ist,c) * n * EC(ist,n) * Pc(ist, 1+(n-1), hnvec_c);
85 x(c,hnvec) = nvec(c) / (Zc(c)+sum(w(1:M,c,hnvec)));
91 hnvec_c = hashpop(oner(nvec,c),Nc,C,prods);
92 Pc(ist, 1 + n, hnvec) = Pc(ist, 1 + n, hnvec) + Dc(ist,c) * EC(ist,n) * x(c,hnvec) * Pc(ist, 1+(n-1), hnvec_c);
96 Pc(ist, 1 + 0, hnvec) = max(eps,1-sum(Pc(ist, 1 + (1:nc), hnvec)));
99 % now compute the normalizing constant
100 last_nnz = find(nvec>0, 1,
'last' );
101 if sum(nvec(1:last_nnz-1)) == sum(Nc(1:last_nnz-1)) && sum(nvec((last_nnz+1):C))==0
102 logX = log(XN(last_nnz));
108 nvec = pprod(nvec, Nc);
111% compute performance indexes at Nc
for closed
classes
112hnvec = hashpop(Nc,Nc,C,prods);
114 hnvec_c = hashpop(oner(Nc,c),Nc,C,prods);
117 for n=1:sum(Nc) % closed
class utilization
118 u(ist,c) = u(ist,c) + Dc(ist,c) * x(c,hnvec) * Eprime(ist,1+n-1) / E(ist,1+n-1) * Pc(ist, 1+n-1, hnvec_c);
124XN(closedClasses) = x(1:C,hnvec);
126UN(1:M,closedClasses) = u(1:M,1:C);
128CN(1:M,closedClasses) = w(1:M,1:C,hnvec);
130QN(1:M,closedClasses) = repmat(XN(closedClasses),M,1) .* CN(1:M,closedClasses);
132% Compute performance indexes at Nc
for open
classes
140 QN(ist,r) = QN(ist,r) + lambda(r) * D(ist,r) * (n+1) * EC(ist,n+1) * Pc(ist, 1+n, hnvec);
143 CN(ist,r) = QN(ist,r) / lambda(r);
144 % Utilization - the formula from Bruell-Balbo-Ashfari does not
145 % match simulation,
this appears to be simly lambda_r*D_{ir}
148 UN(ist,r) = UN(ist,r) + lambda(r) * Eprime(ist,1+n+1) / E(ist,1+n+1) * Pc(ist, 1+n, hnvec);