LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
pfqn_scat.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012-2026, QORE Lab, Imperial College London
3 * All rights reserved.
4 */
5#ifndef LINE_API_PFQN_SCAT_H
6#define LINE_API_PFQN_SCAT_H
7
8/**
9 * @file
10 * @ingroup api_pfqn
11 * Neuse-Chandy SCAT (Self-Correcting Approximation Technique) approximate MVA.
12 *
13 * Templated port of matlab/src/api/pfqn/pfqn_scat.m, cross-checked against
14 * jar/src/main/java/jline/api/pfqn/mva/Pfqn_scat.java.
15 *
16 * SCAT shares the Linearizer fixed point: it carries the mean queue lengths at
17 * the target population N and at the R reduced populations N - e_s, and
18 * corrects the Bard-Schweitzer proportionality assumption with
19 *
20 * Delta(i,r,s) = Q(i,r | N - e_s)/(N - e_s)_r - Q(i,r | N)/N_r,
21 *
22 * held fixed while an inner MVA fixed point is iterated. It differs from
23 * Linearizer in that this correction is refreshed ONCE: SCAT stops after the
24 * first pass, where Linearizer performs the fixed three passes of Chandy and
25 * Neuse (1982), Sec. 4. Cost is therefore about one third of Linearizer's, and
26 * accuracy sits between Bard-Schweitzer (the Delta == 0 special case, pfqn_bs)
27 * and Linearizer. So this is pfqn_egflinearizer with alpha == 1 and one refresh
28 * round, exactly as pfqn_linearizer is the same call with three.
29 *
30 * SCAT's second departure from Linearizer, fitting a probability mass function
31 * centred on the mean queue length at queue-dependent centres instead of
32 * propagating the MVA distribution recursion (Krzesinski and Greyling 1984,
33 * Sec. 4), does not arise here: this entry point covers single-server and delay
34 * stations only, exactly as pfqn_linearizer does. That mass function is
35 * available separately as the "scat" marginal rule of pfqn_ab_amva.
36 *
37 * Arithmetic: inherited from pfqn_egflinearizer. At alpha == 1 the real power
38 * degenerates to a rational operation, but the inner Core loop still stops on
39 * enorm(Q_{k+1} - Q_k) < tol, so what comes back is the iterate the stopping
40 * rule selected rather than the solution of a finite rational problem.
41 *
42 * Reference: D. Neuse, K. M. Chandy, "SCAT: A Heuristic Algorithm for Queueing
43 * Network Models of Computing Systems", ACM SIGMETRICS Perform. Eval. Rev.
44 * 10(3), 1981.
45 */
46
47#include <cstddef>
48#include <vector>
49
52#include "line/num/number.h"
53#include "line/util/matrix.h"
54
55namespace line {
56namespace pfqn {
57
58/**
59 * @brief Neuse-Chandy SCAT (Self-Correcting Approximation Technique)
60 * approximate MVA.
61 *
62 * @param L (M x R) service demands
63 * @param N (R) population per class
64 * @param Z (K x R) think times, summed over rows; may be empty
65 * @param type (M) scheduling discipline; carried, see pfqn_egflinearizer
66 * @param tol convergence tolerance
67 * @param maxiter total inner-iteration budget
68 * @param QN0 (M x R) warm start; may be empty
69 */
70template <class T>
71LinearizerResult<T> pfqn_scat(const Matrix<T>& L, const std::vector<int>& N, const Matrix<T>& Z,
72 const std::vector<SchedStrategy>& type, double tol, int maxiter,
73 const Matrix<T>& QN0) {
74 const std::vector<T> alpha(N.size(), num_traits<T>::from_int(1));
75 // npasses == 1 is what separates SCAT from Linearizer: one Delta refresh, not three
76 return pfqn_egflinearizer(L, N, Z, type, tol, maxiter, alpha, QN0, 1);
77}
78
79template <class T>
80LinearizerResult<T> pfqn_scat(const Matrix<T>& L, const std::vector<int>& N, const Matrix<T>& Z) {
81 return pfqn_scat(L, N, Z, std::vector<SchedStrategy>(), 1e-8, 1000, Matrix<T>());
82}
83
84template <class T>
85LinearizerResult<T> pfqn_scat(const Matrix<T>& L, const std::vector<int>& N) {
86 return pfqn_scat(L, N, Matrix<T>(), std::vector<SchedStrategy>(), 1e-8, 1000, Matrix<T>());
87}
88
89} // namespace pfqn
90} // namespace line
91
92#endif // LINE_API_PFQN_SCAT_H
Dense matrix and non-owning view.
LinearizerResult< T > pfqn_scat(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)
Neuse-Chandy SCAT (Self-Correcting Approximation Technique) approximate MVA.
Definition pfqn_scat.h:71
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...
Number-type abstraction for the templated API port.
Scaffolding shared by the approximate-MVA family.
Extended generalized fixed-point Linearizer (De Souza e Silva and Muntz's generalization of Chandy an...
Return value of the Linearizer family, mirroring [Q,U,W,C,X,totiter].