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

Two approximate MVA schemes: Queue-Line and Fraction-Line. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <vector>
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for pfqn_wangsevcik.h:

Go to the source code of this file.

Classes

struct  line::pfqn::WsResult< T >
 What an approximate MVA sweep reports. More...

Namespaces

namespace  line
namespace  line::pfqn

Enumerations

enum class  line::pfqn::WsScheme { line::pfqn::Qli = 0 , line::pfqn::Fli }
 Which arrival-queue correction the sweep applies. More...

Functions

template<class T>
WsResult< T > line::pfqn::pfqn_wangsevcik (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, WsScheme scheme, double tol=1e-6, std::size_t max_iter=1000)
 One approximate MVA sweep, by the chosen arrival-queue correction.
template<class T>
WsResult< T > line::pfqn::pfqn_qli (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, double tol=1e-6, std::size_t max_iter=1000)
 Wang-Sevcik Queue-Line.
template<class T>
WsResult< T > line::pfqn::pfqn_fli (const Matrix< T > &L, const std::vector< T > &N, const std::vector< T > &Z, double tol=1e-6, std::size_t max_iter=1000)
 Wang-Sevcik Fraction-Line.

Detailed Description

Two approximate MVA schemes: Queue-Line and Fraction-Line.

Port of pfqn_qli and pfqn_fli from python/line_solver/api/pfqn/mva.py. PYTHON-ONLY: neither MATLAB nor the JAR carries them as standalone entry points, so native Python is the reference.

Reference: W. Wang and K. C. Sevcik, "Performance Models for Multiprogrammed Systems", IBM Research Report RC 5925, 1976.

pfqn_qdlin USED TO LIVE HERE AND NO LONGER DOES. Its Wang-Sevcik arm scaled the job's own-class contribution by (N_r - 1)/N_r and left the other classes alone, which is Bard-Schweitzer written out, so the function reproduced pfqn_bs to iteration tolerance and was neither a Linearizer nor queue-dependent. It is now line/api/pfqn/pfqn_qdlin.h, the array-level twin of what SolverMVA computes for method='qdlin'.

BOTH ANSWER ONE QUESTION: what queue does an ARRIVING class-r job see? Exact MVA says it sees the queue at population N - e_r, which is why the exact recursion has to walk the whole population lattice. Every approximation here replaces that by a correction applied to the queue at the FULL population, and the two differ only in the correction:

  • QLI subtracts a 1/(N_r - 1) weighted discrepancy between the own-class queue and its DEMAND-PROPORTIONAL share, so a station that holds more of the class than its demand warrants is discounted more.
  • FLI uses the same proportional share but combines it differently, with a 2/N_r coefficient and the share ADDED rather than subtracted.

THE Q_seen FLOOR AT ZERO IS LOAD-BEARING, not defensive. Both Wang-Sevcik corrections are differences of estimates and can go negative at a lightly loaded station; a negative queue would make the residence time SHORTER than the service demand, which is impossible, and the iteration then diverges away from the fixed point rather than toward it. The reference clamps and so does this.

THE FALLBACK ARM IS NOT THE SAME FORMULA. When the denominator vanishes, or when the population is too small for the correction's own divisor (N_r > 1 for QLI), the reference falls back to Q_total - Q_own, i.e. the other classes only. That is the Bard-Schweitzer arrival estimate, and it is a DIFFERENT approximation, so a caller comparing two runs across that boundary is comparing two schemes.

ARITHMETIC: field.

Definition in file pfqn_wangsevcik.h.