1#ifndef LINE_SOLVERS_NC_SOLVER_NC_SPN_H
2#define LINE_SOLVERS_NC_SOLVER_NC_SPN_H
74 const std::size_t M =
sn.nstations, R =
sn.nclasses;
77 if (
opt.tol > 0) pfopt.
tol = std::max(
opt.tol, 1e-12);
85 out.
sol.actualmethod =
"rec";
86 out.
sol.sol.method =
"rec";
92 out.
sol.sol.X.assign(R, zero);
93 out.
sol.sol.C.assign(R, zero);
95 for (std::size_t pp = 0; pp < pf.
spn.info.places.size(); ++pp) {
96 const std::size_t ist =
sn.nodes[pf.
spn.info.places[pp] - 1].station;
97 if (ist < 1)
continue;
98 out.
sol.sol.Q(ist - 1, 0) = met.
tokens[pp];
101 out.
sol.sol.U(ist - 1, 0) = met.
tokens[pp];
111 const std::size_t ref =
sn.classes.empty() ? 0 :
sn.classes[0].refstat;
112 if (ref >= 1 && ref <= M) out.
sol.sol.X[0] = out.
sol.sol.Tp(ref - 1, 0);
114 for (std::size_t i = 0; i < M; ++i) Nk += out.
sol.sol.Q(i, 0);
115 if (out.
sol.sol.X[0] > zero && Nk > zero) out.
sol.sol.C[0] = T(Nk / out.
sol.sol.X[0]);
A network plus its refreshed NetworkStruct.
Dense matrix and non-owning view.
NcSpnSolution< T > solver_nc_spn_analyzer(const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
Analyse a product-form stochastic Petri net.
SpnMetrics< T > spn_metrics(const mdd::MddStruct &mdds, const std::vector< std::vector< T > > &g, const SpnInfo< T > &info)
Every measure of Sec.
SpnPfResult< T > spn_pf(const qn::NetworkStruct< T > &sn, const SpnPfOptions &options=SpnPfOptions())
Derive the product form of a stochastic Petri net.
Conservation laws of a layered queueing network, enumerated from its structure.
Controls and result shape shared by the normalizing-constant analyzers.
A queueing network and its refreshed NetworkStruct.
Stationary measures of a product-form stochastic Petri net from the MDD-rec masses.
Product form of a stochastic Petri net: decide whether one exists and derive the per-level factors g_...
The [Q,U,R,T,C,X,lG] of the reference, plus the algorithm that ran.
Controls, defaulting to SolverOptions('NC') in the reference.
The product-form solve, with the certificate that produced it.
spn::SpnMetrics< T > metrics
The stationary measures of Sec.
std::vector< T > place_tput
Place throughput, tokens removed per unit time.
T G
The normalising constant G the measures are taken against.
std::vector< T > tokens
Mean tokens per place level.
Options of the product-form derivation.
double tol
Relative tolerance of the rate-law and complex-balance checks.
The product form, and the certificate that it is one.
std::vector< std::vector< T > > g
g[l][k] = g_l(k), ready for mdd_rec.