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

The cftp and cftp.approx methods of SolverNC: stationary analysis of a closed single-class product-form network by PERFECT SAMPLING from its balance function, rather than by evaluating the normalizing constant. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "line/api/pfqn/pfqn_cftp.h"
#include "line/api/pfqn/pfqn_mc_common.h"
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_struct.h"
#include "line/num/number.h"
#include "line/solvers/mva/sn_chain.h"
#include "line/solvers/nc/nc_types.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for solver_nc_cftp.h:

Go to the source code of this file.

Classes

struct  line::nc::NcCftpOptions
 The knobs of one perfect-sampling run. More...
struct  line::nc::NcCftpAvg< T >
 The means of one cftp solve, before the SolverNC metric filter. More...
struct  line::nc::NcCftpSolution< T >
 What one cftp solve produces beside the means. More...

Namespaces

namespace  line
 Conservation laws of a layered queueing network, enumerated from its structure.
namespace  line::nc

Functions

template<class T>
std::string line::nc::solver_nc_cftp_supports (const qn::NetworkStruct< T > &sn)
 The cftp model-class gate as a public predicate.
template<class T>
NcCftpSolution< T > line::nc::solver_nc_cftp (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt, const NcCftpOptions &cftpopt)
 Solve with the cftp / cftp.approx method.
template<class T>
NcCftpSolution< T > line::nc::solver_nc_cftp (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
 Solve with cftp taking the run length and the stream from opt, the options.samples / options.seed every SolverNC estimator reads.
template<class T>
NcSolution< T > line::nc::solver_nc_cftp_solution (const NcCftpSolution< T > &s)
 A cftp solve in the shape every other SolverNC analyzer returns, so the runner's metric filter applies to it unchanged.

Detailed Description

The cftp and cftp.approx methods of SolverNC: stationary analysis of a closed single-class product-form network by PERFECT SAMPLING from its balance function, rather than by evaluating the normalizing constant.

WHY NC AND NOT CTMC. The sampler never builds a generator: it draws states of the Gordon-Newell product form directly from the station balance functions, and its gate is exactly the product-form envelope NC already declares. It was a SolverCTMC method until 2026-09-27 and moved here in all four codebases. It yields no normalizing constant, so lG is left NaN, as for morrison.

Port of matlab/src/solvers/NC/solver_nc_cftp.m. Reference: S. Kijima and T. Matsui, "Approximate/Perfect Samplers for Closed Jackson Networks", Winter Simulation Conference 2005; the sampler itself is pfqn::pfqn_cftp.

WHAT KIND OF NUMBER THIS IS. States are drawn iid from the EXACT stationary distribution, so there is no truncation and no cutoff, but the means are sample averages and carry Monte Carlo error O(samples^(-1/2)). Diffing a cftp row against an exact solver at solver tolerance therefore reads as a defect and is not one – it is the same contract as the SSA row. cftp.approx additionally drops exactness of the DRAW, running the paper's rapidly-mixing sampler M_A for a deterministic number of updates instead of coupling from the past; its running time is bounded where perfect sampling's is not.

WHY THE MODEL CLASS IS GATED SO NARROWLY. The sampler's balance function encodes the closed single-class product form and nothing else, so a model outside that class is REFUSED rather than approximated: the sampler would return states of a different network and the estimator would converge, with shrinking error bars, to the wrong answer.

THE TWO ESTIMATORS ARE NOT INTERCHANGEABLE, and the split is deliberate. Throughput is taken at the REFERENCE station and propagated through the visit ratios, which matches the SolverCTMC convention (XN is the arrival rate at the reference station) and keeps flow balance, Little's law and C = N/X exact in the reported table. Utilization instead keeps its own estimator E[min(n_i,c_i)]/c_i, which is unbiased and confined to [0,1] by construction, whereas deriving it from the reference-station throughput lets Monte Carlo error push a saturated station above one.

Definition in file solver_nc_cftp.h.