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

Superposition of independent renewal flows (Whitt's QNA stationary-interval method). More...

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

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::da

Functions

template<class T>
line::da::da_traffic_superpos (const std::vector< T > &lambda, const std::vector< T > &a2)
 Superposition of independent renewal flows (Whitt's QNA stationary-interval method).

Detailed Description

Superposition of independent renewal flows (Whitt's QNA stationary-interval method).

Templated port of matlab/src/api/da/da_traffic_superpos.m. Given flows with rates lambda(i) and squared coefficients of variation a2(i), the merged flow is assigned the rate-weighted mixture

d2 = sum_i lambda(i) a2(i) / sum_i lambda(i),

flows with a non-finite rate being dropped first (MATLAB's isfinite mask). The rate of the merged flow is sum_i lambda(i) and is not returned: the decomposition step that calls this already holds it.

A weighted mean is a sum and one division, so this is a finite field computation and instantiates at exact arithmetic with no rounding: for rational rates and SCVs the merged SCV is the exact rational mixture. No transcendental gate.

The finiteness mask only ever removes anything in an inexact instantiation; an exact rational is finite by construction, so for T = Rational the mask is the identity and every flow is kept.

Definition in file da_traffic_superpos.h.