1function [XN,QN,UN,RN,TN,it] = sum_closing(lambda0,scva,L,mi,scv,N,Z,Kclosed,tol,maxiter)
2% [XN,QN,UN,RN,TN,IT] = SUM_CLOSING(LAMBDA0,SCVA,L,MI,SCV,N,Z,KCLOSED,TOL,MAXITER)
4% Closing method
for open and mixed non-product-form queueing networks
5% (Bolch et al., Sec. 10.1.5), solved with
the summation method.
7% The external world of each open
class is replaced by an additional
8% -/G/1 station with service rate mu_inf,r = Ropen*lambda0(r), where Ropen
9%
is the number of open classes, service SCV equal to
the interarrival
10% time SCV of
the open
class, and unit visit ratio. The resulting closed
11% network
is then solved by SUM_CLOSED with a large population KCLOSED
12%
for the open classes (
default: 5000, as recommended for
the summation
13% method). Closed classes are passed through unchanged, which makes
the
14% method applicable to mixed networks.
17% lambda0 - 1xR external arrival rates (0 for closed classes)
18% scva - 1xR interarrival time SCVs of
the open classes (1 if Poisson)
19% L - MxR service demand matrix of
the original network, with visit
20% ratios of open classes normalized per external arrival
21% mi - Mx1 number of servers (Inf for infinite-server stations)
22% scv - MxR service time SCVs (pass 1 for insensitive stations)
23% N - 1xR populations: Inf (or NaN) for open classes, finite
24% integers for closed classes
26% Kclosed - closing population for
the open classes (default: 5000)
27% tol - convergence tolerance (default: 1e-6)
28% maxiter - maximum number of iterations (default: 10000)
31% XN - 1xR class throughputs (for open classes, XN approaches lambda0
32% from below as KCLOSED grows)
33% QN - MxR mean queue lengths at
the original stations
34% UN - MxR utilizations at
the original stations
35% RN - MxR residence times at
the original stations
36% TN - 1xR mean response time in
the original network, TN=sum(QN)./XN
37% it - number of iterations
39% Reference: G. Bolch, S. Greiner, H. de Meer, K.S. Trivedi, Queueing
40% Networks and Markov Chains, 2nd ed., Wiley, 2006, Sec. 10.1.5.
42% Copyright (c) 2012-2026, Imperial College London
47if nargin<2 || isempty(scva), scva = ones(1,R); end
48if nargin<4 || isempty(mi), mi = ones(M,1); end
49if nargin<5 || isempty(scv), scv = ones(M,R); end
50if nargin<6 || isempty(N), N = Inf*ones(1,R); end
51if nargin<7 || isempty(Z), Z = zeros(1,R); end
52if nargin<8 || isempty(Kclosed), Kclosed = 5000; end
53if nargin<9 || isempty(tol), tol = 1e-6; end
54if nargin<10 || isempty(maxiter), maxiter = 10000; end
59openClasses = find(lambda0>0);
60Ropen = length(openClasses);
62 line_error(mfilename,
'No open class: use sum_closed for closed networks.');
65% augment with
the closing -/G/1 station, visited by open classes only
66Laug = [L; zeros(1,R)];
67scvaug = [scv; ones(1,R)];
70 Laug(M+1,r) = 1/(Ropen*lambda0(r));
71 scvaug(M+1,r) = scva(r);
76[XN,QNa,UNa,RNa,it] = sum_closed(Laug,Naug,Z,miaug,scvaug,tol,maxiter);
84 TN(r) = sum(QN(:,r))/XN(r);