LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::spn Namespace Reference

Namespaces

namespace  ispn_detail

Classes

struct  IspnOptions
 Options of spn_ispn. More...
struct  IspnResult
 Result of spn_ispn; fields as in the MATLAB help. More...
struct  SpnEnabling
 Unnormalised enabling-degree masses of one mode. More...
struct  SpnInfo
 Everything the caller needs alongside the descriptor. More...
struct  SpnInvariants
 The invariant basis of a net, in PLACE-LEVEL coordinates: one level per (place, class) pair, place-major, level l = pp * nclasses + k for place pp and class k (both 0-based), exactly the (pp - 1) * R + k layout of the reference. More...
struct  SpnLpBounds
 The brackets; each vector pair holds the minimum then the maximum. More...
struct  SpnLpMode
 One (transition, mode) pair over place levels. More...
struct  SpnLpOptions
 Options of the relaxation. More...
struct  SpnMetrics
 The stationary measures of Sec. More...
struct  SpnMode
 One (transition, mode) pair of the net, in level coordinates. More...
struct  SpnOptions
 Options of the translation. More...
struct  SpnPfOptions
 Options of the product-form derivation. More...
struct  SpnPfResult
 The product form, and the certificate that it is one. More...
struct  SpnProperties
struct  SpnReachGraph
struct  SpnReachProps
struct  SpnResult
 Descriptor, diagram and metadata returned together. More...
struct  SpnSiphons
struct  SpnStructProps
struct  SpnTInvariants
struct  SpnTraps

Functions

template<class T>
T spn_conv (const std::vector< std::vector< long long > > &S, const std::vector< long long > &V, const std::vector< std::vector< T > > &g)
 The normalising constant by convolution over the invariant load vector.
template<class T>
T spn_conv (const SpnInvariants &inv, const std::vector< std::vector< T > > &g)
 Convolve straight off the invariant basis spn_sinvariants returned.
std::vector< bool > spn_ispn_covered (const std::vector< std::vector< double > > &C)
 Places covered by a non-negative S-invariant (P-semiflow) y' C = 0, by Farkas' algorithm on [C | I] keeping minimal supports.
IspnResult spn_ispn (const std::vector< std::vector< double > > &pre, const std::vector< std::vector< double > > &post, std::vector< std::vector< double > > inh, const std::vector< double > &rate, std::vector< bool > imm, std::vector< double > srv, const std::vector< double > &m0, std::size_t p0, const IspnOptions &opt=IspnOptions())
 Steady state of an infinite-state SPN.
template<class T>
SpnLpBounds spn_lpbnd (const qn::NetworkStruct< T > &sn, const SpnLpOptions &options=SpnLpOptions())
 Bracket the mean tokens and the throughputs of a stochastic Petri net.
template<class T>
SpnResult< T > spn_mdd (const qn::NetworkStruct< T > &sn, const SpnOptions &options=SpnOptions())
 Build the reachable set and Kronecker descriptor of a stochastic Petri net.
template<class T>
SpnMetrics< T > spn_metrics (const mdd::MddStruct &mdds, const std::vector< std::vector< T > > &g, const SpnInfo< T > &info)
 Every measure of Sec.
template<class T>
SpnPfResult< T > spn_pf (const qn::NetworkStruct< T > &sn, const SpnPfOptions &options=SpnPfOptions())
 Derive the product form of a stochastic Petri net.
template<class T>
SpnProperties spn_properties (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >(), std::size_t maxstates=0)
template<class T>
SpnReachGraph spn_reachgraph (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >(), std::size_t maxstates=0)
template<class T>
SpnReachProps spn_reachprops (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >(), std::size_t maxstates=0)
template<class T>
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.
template<class T>
SpnInvariants spn_sinvariants (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())
 Minimal-support S-invariants and the load vector of a net.
template<class T>
SpnSiphons spn_siphons (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())
template<class T>
SpnStructProps spn_structprops (const qn::NetworkStruct< T > &sn)
template<class T>
SpnTInvariants spn_tinvariants (const qn::NetworkStruct< T > &sn)
template<class T>
SpnTraps spn_traps (const qn::NetworkStruct< T > &sn, const std::vector< double > &init=std::vector< double >())

Variables

constexpr std::size_t SPN_REACH_MAXSTATES = 100000
 Default cap on the number of explored markings.

Function Documentation

◆ spn_conv() [1/2]

template<class T>
T line::spn::spn_conv ( const SpnInvariants & inv,
const std::vector< std::vector< T > > & g )

Convolve straight off the invariant basis spn_sinvariants returned.

Definition at line 125 of file spn_conv.h.

References spn_conv().

◆ spn_conv() [2/2]

template<class T>
T line::spn::spn_conv ( const std::vector< std::vector< long long > > & S,
const std::vector< long long > & V,
const std::vector< std::vector< T > > & g )

The normalising constant by convolution over the invariant load vector.

Parameters
SS[i][p], the minimal-support S-invariants, one row per invariant
Vthe load vector S m0, one entry per invariant
gg[p][i] is g_p(i), the product-form factor of i tokens in place p; its length bounds the marking of place p

Definition at line 105 of file spn_conv.h.

References line::InputError::InputError(), and spn_conv().

Referenced by spn_conv(), and spn_conv().

◆ spn_ispn()

IspnResult line::spn::spn_ispn ( const std::vector< std::vector< double > > & pre,
const std::vector< std::vector< double > > & post,
std::vector< std::vector< double > > inh,
const std::vector< double > & rate,
std::vector< bool > imm,
std::vector< double > srv,
const std::vector< double > & m0,
std::size_t p0,
const IspnOptions & opt = IspnOptions() )
inline

Steady state of an infinite-state SPN.

Parameters
preP x T input multiplicities
postP x T output multiplicities
inhP x T inhibitor thresholds (t disabled when m(p) >= inh), +inf for none; empty: none
ratelength-T timed rate, or the weight of an immediate transition
immlength-T, true for an immediate transition; empty: all timed
srvlength-T servers (+inf allowed); empty: all 1. A transition with no input fires at rate(t)
m0length-P initial marking
p00-based index of the unbounded place

Definition at line 631 of file spn_ispn.h.

References line::spn::IspnResult::A0, line::spn::IspnResult::A1, line::spn::IspnResult::A2, line::spn::IspnResult::B, line::spn::IspnResult::drift, line::eye(), line::spn::IspnResult::K, line::spn::IspnResult::L, line::spn::IspnResult::leveldist, line::spn::IspnResult::levelmarkings, line::spn::IspnResult::leveltail, line::spn::IspnResult::marginal, line::spn::IspnResult::meanmarking, line::spn::IspnResult::ntangible, line::spn::IspnResult::nvanishing, line::mam::qbd_R(), line::mam::qbd_R_logred(), line::spn::IspnResult::R, line::spn::IspnResult::reward, line::spectral_radius(), spn_ispn(), line::spn::IspnResult::spR, line::spn::IspnResult::tput, line::spn::IspnResult::varlevel, and line::spn::IspnResult::x.

Referenced by line::mam::solver_mam_ispn(), and spn_ispn().

◆ spn_ispn_covered()

std::vector< bool > line::spn::spn_ispn_covered ( const std::vector< std::vector< double > > & C)
inline

Places covered by a non-negative S-invariant (P-semiflow) y' C = 0, by Farkas' algorithm on [C | I] keeping minimal supports.

The uncovered places are the candidates for the unbounded place of an iSPN.

Parameters
CP x T incidence matrix POST - PRE

Definition at line 579 of file spn_ispn.h.

References line::InputError::InputError(), and spn_ispn_covered().

Referenced by line::mam::solver_mam_ispn(), and spn_ispn_covered().

◆ spn_lpbnd()

template<class T>
SpnLpBounds line::spn::spn_lpbnd ( const qn::NetworkStruct< T > & sn,
const SpnLpOptions & options = SpnLpOptions() )

Bracket the mean tokens and the throughputs of a stochastic Petri net.

Parameters
sna NetworkStruct holding Places and Transitions
optionsthe relaxation options
Returns
the brackets, per place level and per mode

Definition at line 158 of file spn_lpbnd.h.

References line::spn::SpnLpBounds::bound, line::mam::Map< T >::D1, line::lang::dist_to_map(), line::lp::LpModel< T >::emit_eq(), line::lp::LpModel< T >::emit_ge(), line::lp::LpModel< T >::emit_le(), line::spn::SpnLpMode::enab, line::qn::TransitionParam< T >::enabling, line::lp::EQ, line::spn::SpnLpMode::fire, line::qn::TransitionParam< T >::firing, line::qn::TransitionParam< T >::firingdep, line::qn::TransitionParam< T >::firingproc, line::lang::IMMEDIATE, line::spn::SpnLpMode::inhib, line::qn::TransitionParam< T >::inhibiting, line::InputError::InputError(), line::spn::SpnLpBounds::levelname, line::mam::map_mean(), line::spn::SpnLpBounds::markovian, line::spn::SpnLpMode::mode, line::spn::SpnLpBounds::mode_tput_hi, line::spn::SpnLpBounds::mode_tput_lo, line::spn::SpnLpBounds::mode_util_hi, line::spn::SpnLpBounds::mode_util_lo, line::spn::SpnLpBounds::modes, line::spn::SpnLpBounds::nclasses, line::qn::TransitionParam< T >::nmodes, line::qn::TransitionParam< T >::nmodeservers, line::spn::SpnLpBounds::nplacelevels, line::spn::SpnLpBounds::nrows, line::lp::LpModel< T >::num_rows(), line::spn::SpnLpBounds::nvars, line::mam::Map< T >::order(), line::lang::Place, line::spn::SpnLpBounds::place_tput_hi, line::spn::SpnLpBounds::place_tput_lo, line::spn::SpnLpBounds::places, line::spn::SpnLpMode::rate, line::lp::LpModel< T >::row_add(), line::lp::LpModel< T >::row_clear(), line::lp::LpModel< T >::sense(), line::lp::LpModel< T >::set_bounds(), spn_lpbnd(), spn_sinvariants(), line::qn::TransitionParam< T >::timing, line::spn::SpnLpBounds::tokens_hi, line::spn::SpnLpBounds::tokens_lo, line::spn::SpnLpMode::trans, line::lang::Transition, and line::UnsupportedError::UnsupportedError().

Referenced by line::ba::solver_ba_spnlp_analyzer(), and spn_lpbnd().

◆ spn_mdd()

template<class T>
SpnResult< T > line::spn::spn_mdd ( const qn::NetworkStruct< T > & sn,
const SpnOptions & options = SpnOptions() )

Build the reachable set and Kronecker descriptor of a stochastic Petri net.

Parameters
sna NetworkStruct holding Places and Transitions
optionstranslation options

Definition at line 403 of file spn_mdd.h.

References line::mdd::MddEvent< T >::a, line::mdd::MddLocalMatrix< T >::Builder::add(), line::mdd::MddLocalMatrix< T >::Builder::build(), line::mdd::MDD::cardinality(), line::spn::SpnInfo< T >::classnames, line::mdd::MDD::compact(), line::mam::Map< T >::D0, line::spn::SpnMode< T >::D0, line::mam::Map< T >::D1, line::spn::SpnMode< T >::D1, line::spn::SpnMode< T >::dep, line::spn::SpnResult< T >::desc, line::spn::SpnInfo< T >::descriptor, line::spn::SpnInfo< T >::diagram, line::lang::dist_to_map(), line::spn::SpnMode< T >::enab, line::qn::TransitionParam< T >::enabling, line::spn::SpnInfo< T >::ever_disabled, line::spn::SpnMode< T >::fire, line::qn::TransitionParam< T >::firing, line::qn::TransitionParam< T >::firingdep, line::qn::TransitionParam< T >::firingproc, line::lang::IMMEDIATE, line::spn::SpnResult< T >::info, line::spn::SpnMode< T >::inhib, line::qn::TransitionParam< T >::inhibiting, line::spn::SpnInfo< T >::init, line::InputError::InputError(), line::mdd::MDD::insert(), line::mdd::MddDescriptor< T >::K, line::spn::SpnInfo< T >::levelkind, line::spn::SpnInfo< T >::levelname, line::mdd::mdd_entry_law(), line::spn::SpnResult< T >::mdds, line::mdd::MDD::member(), line::spn::SpnMode< T >::mode, line::spn::SpnInfo< T >::modes, line::spn::SpnInfo< T >::nclasses, line::qn::TransitionParam< T >::nmodes, line::qn::TransitionParam< T >::nmodeservers, line::spn::SpnInfo< T >::nnodes, line::spn::SpnMode< T >::nph, line::spn::SpnInfo< T >::nplacelevels, line::mam::Map< T >::order(), line::spn::SpnInfo< T >::phaseof, line::spn::SpnMode< T >::pie, line::lang::Place, line::spn::SpnInfo< T >::placenames, line::spn::SpnInfo< T >::places, spn_mdd(), line::spn::SpnMode< T >::srv, line::qn::TransitionParam< T >::timing, line::mdd::MDD::to_struct(), line::spn::SpnMode< T >::trans, line::lang::Transition, and line::UnsupportedError::UnsupportedError().

Referenced by spn_mdd(), and spn_pf().

◆ spn_metrics()

◆ spn_pf()

◆ spn_properties()

◆ spn_reachgraph()

template<class T>
SpnReachGraph line::spn::spn_reachgraph ( const qn::NetworkStruct< T > & sn,
const std::vector< double > & init = std::vector<double>(),
std::size_t maxstates = 0 )
Parameters
initinitial marking per level; empty: the declared Place state, else the reference station populations
maxstatescap on the number of markings (0: SPN_REACH_MAXSTATES)

Definition at line 145 of file spn_reachgraph.h.

References SPN_REACH_MAXSTATES, and spn_reachgraph().

Referenced by spn_reachgraph(), and spn_reachprops().

◆ spn_reachprops()

◆ spn_rec_enabled()

template<class T>
SpnEnabling< T > line::spn::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.

Parameters
mddsthe reachable set built by spn_mdd
gper-level product-form factors, one vector per level
mdethe mode, as returned in SpnInfo::modes
nplacelevelshow many leading levels are place levels

Definition at line 64 of file spn_rec_enabled.h.

References line::mdd::MddStruct::domain, line::spn::SpnMode< T >::enab, line::spn::SpnEnabling< T >::eq, line::spn::SpnEnabling< T >::ge, line::spn::SpnMode< T >::inhib, line::InputError::InputError(), line::mdd::MddStruct::K, line::spn::SpnEnabling< T >::max_degree, line::mdd::mdd_rec_masked(), and spn_rec_enabled().

Referenced by spn_metrics(), and spn_rec_enabled().

◆ spn_sinvariants()

template<class T>
SpnInvariants line::spn::spn_sinvariants ( const qn::NetworkStruct< T > & sn,
const std::vector< double > & init = std::vector<double>() )

Minimal-support S-invariants and the load vector of a net.

Parameters
sna NetworkStruct holding Places and Transitions
initinitial marking per place level (P * R entries, place-major); empty takes it from the reference station of each closed class, as spn_mdd does

Definition at line 124 of file spn_sinvariants.h.

References line::qn::TransitionParam< T >::enabling, line::qn::TransitionParam< T >::firing, line::InputError::InputError(), line::spn::SpnInvariants::m0, line::spn::SpnInvariants::nclasses, line::qn::TransitionParam< T >::nmodes, line::lang::Place, line::spn::SpnInvariants::places, line::spn::SpnInvariants::S, spn_sinvariants(), and line::lang::Transition.

Referenced by spn_lpbnd(), spn_properties(), and spn_sinvariants().

◆ spn_siphons()

template<class T>
SpnSiphons line::spn::spn_siphons ( const qn::NetworkStruct< T > & sn,
const std::vector< double > & init = std::vector<double>() )

◆ spn_structprops()

◆ spn_tinvariants()

template<class T>
SpnTInvariants line::spn::spn_tinvariants ( const qn::NetworkStruct< T > & sn)

◆ spn_traps()

template<class T>
SpnTraps line::spn::spn_traps ( const qn::NetworkStruct< T > & sn,
const std::vector< double > & init = std::vector<double>() )

Variable Documentation

◆ SPN_REACH_MAXSTATES

std::size_t line::spn::SPN_REACH_MAXSTATES = 100000
constexpr

Default cap on the number of explored markings.

Definition at line 41 of file spn_reachgraph.h.

Referenced by spn_reachgraph().