LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
pfqn_ncldmx.m
1%{
2%{
3 % @file pfqn_ncldmx.m
4 % @brief Normalizing constant for mixed open/closed networks with limited load dependence.
5%}
6%}
7
8%{
9%{
10 % @brief Normalizing constant for mixed open/closed networks with limited load dependence.
11 %
12 % The closed-conditional normalizing constant of a mixed limited load-dependent
13 % (LLD) network equals a purely closed load-dependent normalizing constant in
14 % which every queueing station i carries the Bruell-Balbo-Afshari effective
15 % capacity rate mu_i^eff(n) = 1/EC_i(n), where EC is returned by
16 % pfqn_ldmx_ec and folds the open classes into the closed subnetwork. The
17 % open classes contribute the separable prefactor lGopen = sum_i log E_i(0),
18 % which reduces to -sum_i log(1-rho_i) in the load-independent limit.
19 %
20 % Mean closed metrics follow from the standard normalizing-constant ratios,
21 % e.g. X_r = G(N-e_r)/G(N), matching the exact pfqn_mvaldmx solver.
22 %
23 % @fn pfqn_ncldmx(lambda, D, N, Z, mu, S, varargin)
24 % @param lambda Arrival rate vector (0 on closed classes).
25 % @param D Service demand matrix (MxR).
26 % @param N Population vector (Inf on open classes).
27 % @param Z Think time vector (closed classes).
28 % @param mu Load-dependent rate matrix (Mx>=sum(N_closed)).
29 % @param S Number of servers per station (currently informational).
30 % @param varargin Optional solver parameters forwarded to pfqn_ncld.
31 % @return lG Logarithm of the closed-conditional normalizing constant.
32 % @return G Closed-conditional normalizing constant (exp(lG)).
33 % @return lGopen Logarithm of the open-class normalizing prefactor sum_i log E_i(0).
34%}
35%}
36function [lG,G,lGopen] = pfqn_ncldmx(lambda,D,N,Z,mu,S,varargin)
37% [LG,G,LGOPEN] = PFQN_NCLDMX(LAMBDA,D,N,Z,MU,S,VARARGIN)
38
39[M,R] = size(D);
40if nargin<5 || isempty(mu)
41 mu = ones(M,max(1,sum(N(isfinite(N)))));
42end
43if nargin<6 || isempty(S)
44 S = ones(M,1); %#ok<NASGU> % kept for signature parity with pfqn_mvaldmx
45end
46if nargin<4 || isempty(Z)
47 Z = zeros(1,R);
48end
49
50openClasses = find(isinf(N));
51closedClasses = setdiff(1:R, openClasses);
52
53if any(N(intersect(find(lambda),closedClasses))>0)
54 line_error(mfilename,'Arrival rate cannot be specified on closed classes.');
55end
56
57Nc = N(closedClasses);
58Kc = sum(Nc);
59
60% open-class normalizing prefactor sum_i log E_i(0); needs the effective
61% capacity terms even when there are no closed jobs.
62mup = mu;
63if size(mup,2) < max(1,Kc)
64 mup = [mup, repmat(mup(:,end), 1, max(1,Kc)-size(mup,2))];
65end
66mup = [mup, mup(:,end)]; % one extra column as in pfqn_mvaldmx
67lambdao = zeros(1,R); lambdao(openClasses) = lambda(openClasses);
68[EC,E] = pfqn_ldmx_ec(lambdao, D, mup);
69lGopen = sum(log(E(1:M,1)));
70
71% closed-conditional normalizing constant
72if Kc==0
73 lG = 0;
74 G = 1;
75 return
76end
77Dc = D(:,closedClasses);
78Zc = Z(closedClasses);
79muEff = 1 ./ EC(:,1:Kc);
80[lG,G] = pfqn_ncld(Dc, Nc, Zc, muEff, varargin{:});
81end
Definition Station.m:245