LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_mvaoi.h File Reference

Mean-value analysis of a closed network with order-independent (OI) stations, the composition-dependent generalization of Conditional MVA. More...

#include <algorithm>
#include <cstddef>
#include <functional>
#include <map>
#include <vector>
#include "line/api/pfqn/pfqn_comb_common.h"
#include "line/api/pfqn/pfqn_oi_insvc.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_mvaoi.h:

Go to the source code of this file.

Classes

struct  line::pfqn::MvaoiResult< T >
 Return value of pfqn_mvaoi, mirroring [X, Qoi, Qli, Qdelay, Soi]. More...

Namespaces

namespace  line
namespace  line::pfqn

Functions

template<class T>
MvaoiResult< T > line::pfqn::pfqn_mvaoi (const std::vector< T > &Z, const std::vector< int > &N, const std::vector< std::function< T(const std::vector< int > &)> > &mu, const Matrix< T > &Dli, const Matrix< T > &visits, bool want_soi)
 Mean-value analysis of a closed network with order-independent (OI) stations, the composition-dependent generalization of Conditional MVA.
template<class T>
MvaoiResult< T > line::pfqn::pfqn_mvaoi (const std::vector< T > &Z, const std::vector< int > &N, const std::vector< std::function< T(const std::vector< int > &)> > &mu, const Matrix< T > &Dli, bool want_soi)
 Overload with unit visits.
template<class T>
MvaoiResult< T > line::pfqn::pfqn_mvaoi (const std::vector< T > &Z, const std::vector< int > &N, const std::vector< std::function< T(const std::vector< int > &)> > &mu, const Matrix< T > &Dli, const Matrix< T > &visits)
 Overload without the in-service means.
template<class T>
MvaoiResult< T > line::pfqn::pfqn_mvaoi (const std::vector< T > &Z, const std::vector< int > &N, const std::vector< std::function< T(const std::vector< int > &)> > &mu, const Matrix< T > &Dli)
 Overload without the in-service means, unit visits.

Detailed Description

Mean-value analysis of a closed network with order-independent (OI) stations, the composition-dependent generalization of Conditional MVA.

Templated port of matlab/src/api/pfqn/pfqn_mvaoi.m. The network is an aggregated delay node, any number of load-independent single-server queues, and any number of OI / pass-and-swap stations with empty swap graph. It returns the same exact throughputs and queue lengths as pfqn_ncoi WITHOUT forming any normalizing constant or joint marginal.

The recursion carries, per OI station i, the shift vector s_i, the OI occupancy already committed at the bottom of that station; S is the K x R matrix of those rows and Nn = N - sum_i s_i the jobs still free. For a single OI station and no LI queue,

Q^{(S)}(Nn) = sum_r U_r^{(S)}(Nn) ( e_r + Q^{(S + e_r@i)}(Nn - e_r) ) U_r^{(S)}(Nn) = D_r^{(S)}(Nn) X_r^{(S)}(Nn) D_r^{(S)}(Nn) = (1/mu_i(s_i + e_r)) rho^{(S)}_{i,r}(Nn - e_r), Nn_r = 1 D_r^{(S)}(Nn) = [X_r^{(S)}/X_r^{(S+e_r@i)}](Nn - e_r) D_r^{(S)}(Nn-e_r), Nn_r >= 2 rho^{(S)}_{i,r}(M) = rho^{(S)}_{i,r}(M - e_s) X_s^{(S)}(M)/X_s^{(S+e_r@i)}(M)

with each OI station keeping its own D, rho and Q driven by the common throughput, and the population-conservation identity aggregating every station. States (S, Nn) are processed by increasing sum(Nn), so every reference lands at a strictly smaller free population.

THE THROUGHPUT CLOSURE IS NOT A LINEAR SOLVE, and that is deliberate in the reference. The OI queue recurrence couples X_s (s != r) through the off-diagonal of A, so A X = Nn is not a per-class Little's-law ratio as in canonical CMVA. Rather than solving the system, the reference decouples it with the product-form throughput-ratio identity at fixed shift, X_s(Nn)/X_r(Nn) = X_s(Nn-e_r)/X_r(Nn-e_s), giving a scalar per-class formula fed by one-job-less throughputs already in the cache. The port keeps that form; substituting a linear solve would change the numbers.

Soi, the mean number of IN-SERVICE jobs per class, is the only output that is not a pure mean-value quantity. It is a distributional statistic and comes from the OI count marginal pM_i(n|k) = (1/mu_i(n)) sum_r X_r(k) pM_i(n - e_r | k - e_r), pM_i(0|k) = 1 - sum_{n != 0} pM_i(n|k), assembled from the zero-shift throughputs the mean-value recursion has already cached, weighted by pfqn_oi_insvc's E[sir_r | n]. Still no normalizing constant. It is computed only when want_soi is set, mirroring the reference's nargout >= 5 guard.

Arithmetic: EXACT-CAPABLE. Additions, multiplications, divisions and comparisons in the field of the inputs; no logarithm, no tolerance, no iteration to convergence. The OI rate handle must return a T.

REFERENCE DEFECTS: none found. Agreement with pfqn_mvaoi_marg, which reaches the same numbers by an entirely different (marginal-distribution, iterated) route, is to ~2e-14 on every model tried, the gap being that routine's fixed-point tolerance rather than a disagreement.

Definition in file pfqn_mvaoi.h.