5#ifndef LINE_API_SPN_SPN_METRICS_H
6#define LINE_API_SPN_SPN_METRICS_H
86 throw NumericError(
"spn_metrics: the normalising constant is not positive; the g_l passed "
87 "do not describe a product form over this reachable set");
89 out.
marginal.assign(L, std::vector<T>());
90 out.
tokens.assign(L, zero);
93 for (std::size_t l = 0; l < L; ++l) {
95 out.
marginal[l].assign(mass.size(), zero);
96 for (std::size_t k = 0; k < mass.size(); ++k) {
105 for (std::size_t e = 0; e < info.
modes.size(); ++e) {
114 "spn_metrics: mode " + std::to_string(mde.
mode + 1) +
" of node " +
115 std::to_string(mde.
trans) +
116 " has a phase-type firing time, whose throughput is not W(T) times an enabling "
117 "probability; read it from the phase-level marginal instead");
126 "spn_metrics: mode " + std::to_string(mde.
mode + 1) +
" of node " +
127 std::to_string(mde.
trans) +
128 " has a marking-dependent firing rate, so its throughput is not W(T) times a "
129 "function of the enabling degree and cannot be read from the enabling-degree "
130 "law. The token marginals are still exact");
131 const T rate = mde.
D1(0, 0);
133 for (std::size_t k = 1; k < en.
eq.size(); ++k) {
134 const double kd =
static_cast<double>(k);
135 const double served = std::isinf(mde.
srv) ? kd : (kd < mde.
srv ? kd : mde.
srv);
139 for (std::size_t l = 0; l < L; ++l)
NumericError(const std::string &what)
UnsupportedError(const std::string &what)
The exception types the port throws.
Quasi-reduced ordered Multi-valued Decision Diagram.
MDD-rec: the normalising constant of a product-form model whose reachable set is held in a decision d...
T mdd_rec(const MddStruct &mdds, const std::vector< std::vector< T > > &g)
The normalising constant G = sum_{s in S} prod_l g_l(s_l).
std::vector< T > mdd_rec_marginal(const MddStruct &mdds, const std::vector< std::vector< T > > &g, std::size_t l)
Unnormalised masses of {s in S : s_l = k}, one per local value k of level l.
SpnMetrics< T > spn_metrics(const mdd::MddStruct &mdds, const std::vector< std::vector< T > > &g, const SpnInfo< T > &info)
Every measure of Sec.
SpnEnabling< T > spn_rec_enabled(const mdd::MddStruct &mdds, const std::vector< std::vector< T > > &g, const SpnMode< T > &mde, std::size_t nplacelevels)
Enabling-degree masses of mode mde over the reachable set in mdds.
Number-type abstraction for the templated API port.
Decision-diagram reachable set and Kronecker rate descriptor of a stochastic Petri net,...
Enabling-degree distribution of one mode of a product-form stochastic Petri net, by the masked MDD-re...
Plain-array export of an MDD, the input contract of mdd_mcd.
Unnormalised enabling-degree masses of one mode.
std::vector< T > eq
eq[k] is the mass of {e == k}, i.e.
std::vector< T > ge
ge[k] is the mass of {e >= k}; ge[0] is the whole reachable set.
Everything the caller needs alongside the descriptor.
std::vector< SpnMode< T > > modes
The stationary measures of Sec.
std::vector< T > mode_util
Transition (mode) utilization, P(e_j >= 1).
std::vector< T > place_tput
Place throughput, tokens removed per unit time.
std::vector< T > mode_tput
Transition (mode) throughput.
std::vector< std::vector< T > > marginal
marginal[l][k] = P(m_l = k).
std::vector< T > place_util
Place utilization, P(m_j > 0).
T G
The normalising constant G the measures are taken against.
std::vector< T > tokens
Mean tokens per place level.
One (transition, mode) pair of the net, in level coordinates.
std::size_t trans
1-based node index of the transition.
std::vector< double > enab
Enabling multiplicity per place level.
std::function< T(const std::vector< T > &)> dep
Marking-dependent firing-rate multiplier; empty for the unit one.
std::size_t mode
Mode index within the transition, 0-based.