106 const std::vector<int>& N,
const Matrix<T>& Z,
107 const std::vector<int>& nservers,
108 const std::vector<SchedStrategy>& type,
double tol,
113 const std::size_t M = L.
rows();
114 const std::size_t R = N.size();
117 "pfqn_linearizermx: demand matrix and population vector disagree on the class count");
118 if (lambda.size() != R)
119 throw InputError(
"pfqn_linearizermx: arrival-rate vector has the wrong class count");
120 if (nservers.size() != M)
121 throw InputError(
"pfqn_linearizermx: server-count vector has the wrong station count");
122 if (!type.empty() && type.size() != M)
123 throw InputError(
"pfqn_linearizermx: scheduling vector has the wrong station count");
124 for (
int c : nservers)
125 if (c < 1)
throw InputError(
"pfqn_linearizermx: server count below one");
130 std::vector<std::size_t> openC, closedC;
131 for (std::size_t r = 0; r < R; ++r) {
135 if (N[r] < 0)
throw InputError(
"pfqn_linearizermx: negative population");
138 if (N[r] > 0 && lambda[r] != zero)
140 "pfqn_linearizermx: arrival rate cannot be specified on closed classes");
141 closedC.push_back(r);
149 res.
C.assign(R, zero);
150 res.
X.assign(R, zero);
153 for (std::size_t r : openC) {
154 res.
X[r] = lambda[r];
155 for (std::size_t i = 0; i < M; ++i) res.
U(i, r) = lambda[r] * L(i, r);
158 std::vector<T> Ut(M, zero);
159 for (std::size_t i = 0; i < M; ++i)
160 for (std::size_t r : openC) Ut[i] += res.
U(i, r);
162 const std::vector<T> Zs =
sum_rows(Z, R);
164 const std::size_t Rc = closedC.size();
166 for (std::size_t i = 0; i < M; ++i) {
167 const T slack = one - Ut[i];
171 "pfqn_linearizermx: open-class traffic saturates a station, the closed-class "
172 "demand correction 1/(1 - U_open) is not positive");
173 for (std::size_t k = 0; k < Rc; ++k) Dc(i, k) = L(i, closedC[k]) / slack;
176 std::vector<int> Nc(Rc, 0);
178 for (std::size_t k = 0; k < Rc; ++k) {
179 Nc[k] = N[closedC[k]];
180 Zc(0, k) = Zs[closedC[k]];
186 if (QN0.
cols() == R) {
188 for (std::size_t i = 0; i < M; ++i)
189 for (std::size_t k = 0; k < Rc; ++k) QN0c(i, k) = QN0(i, closedC[k]);
190 }
else if (QN0.
cols() == Rc) {
196 for (
int c : nservers)
197 if (c > cmax) cmax = c;
202 }
else if (cmax == 1) {
210 std::vector<T> alphaM(Rc, zero);
211 for (std::size_t k = 0; k < Rc; ++k) {
220 const double n =
static_cast<double>(Nc[k]);
222 0.6 + 1.4 * std::exp(-8.0 * std::exp(-0.8 * n)));
238 for (std::size_t k = 0; k < Rc; ++k) {
239 const std::size_t r = closedC[k];
242 for (std::size_t i = 0; i < M; ++i) {
243 res.
Q(i, r) = sub.Q(i, k);
244 res.
W(i, r) = sub.W(i, k);
247 res.
U(i, r) = res.
X[r] * L(i, r);
251 for (std::size_t i = 0; i < M; ++i) {
253 for (std::size_t k = 0; k < Rc; ++k) qsum += sub.Q(i, k);
254 for (std::size_t r : openC) {
255 res.
W(i, r) = L(i, r) * qsum / (one - Ut[i]);
256 res.
Q(i, r) = res.
W(i, r) * res.
X[r];
259 for (std::size_t r : openC) {
261 for (std::size_t i = 0; i < M; ++i) c += res.
W(i, r);
LinearizerResult< T > pfqn_gflinearizer(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const T &alpha, const Matrix< T > &QN0)
Generalized fixed-point Linearizer with a single scaling exponent shared by every class (De Souza e S...
LinearizerResult< T > pfqn_linearizermx(const std::vector< T > &lambda, const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< int > &nservers, const std::vector< SchedStrategy > &type, double tol, int maxiter, LinearizerMxMethod method, const Matrix< T > &QN0)
Linearizer for mixed open/closed queueing networks.
LinearizerResult< T > pfqn_egflinearizer(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const std::vector< T > &alpha, const Matrix< T > &QN0, int npasses=3)
Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy an...
LinearizerResult< T > pfqn_linearizerms(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< int > &nservers, const std::vector< SchedStrategy > &type, double tol, int maxiter, const Matrix< T > &QN0)
Multiserver Linearizer (Krzesinski's Linearizer as described in Conway 1989, with De Souza e Silva an...
LinearizerResult< T > pfqn_linearizer(const Matrix< T > &L, const std::vector< int > &N, const Matrix< T > &Z, const std::vector< SchedStrategy > &type, double tol, int maxiter, const Matrix< T > &QN0)
Chandy-Neuse Linearizer for single-server stations.