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

Flow-equivalent-server aggregation: replace a station subset by one station. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <string>
#include <vector>
#include "line/api/fes/fes_beta_handle.h"
#include "line/api/fes/fes_build_isolated.h"
#include "line/api/fes/fes_compute_throughputs.h"
#include "line/api/fes/fes_validate.h"
#include "line/api/mc/dtmc_stochcomp.h"
#include "line/api/pfqn/cd_peak_scaling.h"
#include "line/lang/qn/network_builder.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for fes_aggregate.h:

Go to the source code of this file.

Classes

struct  line::fes::FesOptions
 options of the reference; the solver field is implied by the convolution. More...
struct  line::fes::FesDeaggInfo< T >
 Everything needed to map an FES result back onto the original model. More...
struct  line::fes::FesAggregateResult< T >
 What fes_aggregate returns. More...

Namespaces

namespace  line
namespace  line::fes

Typedefs

template<class T>
using line::fes::CdScaling
 A class-dependent scaling map, sn.cdscaling.

Enumerations

enum class  line::fes::SchedStrategy
 Scheduling disciplines, with the values of MATLAB SchedStrategy. More...

Functions

template<class T>
FesAggregateResult< T > line::fes::fes_aggregate (const qn::NetworkStruct< T > &sn, const std::vector< std::size_t > &subsetIndices, const FesOptions &options=FesOptions())
 Flow-equivalent-server aggregation: replace a station subset by one station.

Detailed Description

Flow-equivalent-server aggregation: replace a station subset by one station.

Templated port of matlab/src/io/@ModelAdapter/aggregateFES.m (the JAR twin is the deprecated jline.api.fes.FESAggregator, reached through ModelAdapter.aggregateFES; MATLAB is the reference here).

This is Chandy-Herzog-Woo's Norton theorem in its state-dependent form. The subset is short-circuited and solved in isolation at every population on the lattice; the resulting per-class throughputs X_r(n) become the service rates of a single limited-class-dependent station, and the complement is rewired to route through it. For a product-form closed network the replacement is EXACT at every population, which is what makes the transform worth doing rather than an approximation to be tuned.

THREE THINGS THE ARITHMETIC DEPENDS ON, each easy to get wrong:

  1. The routing seen by the subset is the STOCHASTIC COMPLEMENT of the full chain on the subset's rows, not the raw submatrix. A job that leaves the subset and comes back through the complement must re-enter with the right probability, and dtmc_stochcomp is what folds those excursions back in.
  2. The isolated throughput is a rate INSIDE the subnetwork, whose visit ratios are normalized to the subset. Turning it into a rate the outside sees needs the per-class ESCAPE factor – the visit-weighted probability of leaving the subset per subset visit. Without it the FES completes jobs at the subnetwork's internal circulation rate, which is too fast by exactly the number of internal hops per escape.
  3. The class dependence carries beta_r(n) = X_r(n) |n| / n_r, not X_r(n). The |n|/n_r cancels the processor-sharing split the convolution applies (Sauer 1983, eq. 40), so the aggregate really completes class r at X_r(n). fes_beta_handle owns that factor; this file must not apply it twice.

ONE DELIBERATE DEPARTURE FROM MATLAB, and it is a correctness fix rather than a convention: the reference rebuilds each complement station's service law from sn.proc{i}{k} as APH(ones(1,n)/n, T) whenever the process has more than one phase, i.e. it DISCARDS the true initial phase vector and substitutes a uniform one. That silently changes the distribution of every non-exponential complement station (an Erlang(k) becomes a mixture starting in a random phase, with a different mean and a much larger SCV). The port copies the station's own Distrib verbatim instead, so a complement station keeps exactly the law it had. On exponential service – the case the reference's own tests exercise – the two agree, since a one-phase process is rebuilt as Exp(rate) either way.

ARITHMETIC: transcendental, inherited from the convolution behind fes_compute_throughputs.

Definition in file fes_aggregate.h.