LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::qn::TransitionParam< T > Struct Template Reference

The parameters of a Transition node: MATLAB sn.nodeparam{ind} for an SPN transition, as refreshPetriNetNodes.m writes them. More...

#include <line/lang/qn/network_struct.h>

Inheritance diagram for line::qn::TransitionParam< T >:
Collaboration diagram for line::qn::TransitionParam< T >:

Classes

struct  FluidArc
 One fluid arc of a mode: node is the 1-based fluid place, value a rate or an impulse. More...
struct  FluidGuard
 A fluid guard: the mode is enabled only while level(node) >= thr (sgn = +1) or <= thr (sgn = -1). More...
struct  FluidDep
 A fluid rate dependence: the firing rate is multiplied by fun(level(node)). More...
struct  FluidFlowDep
 A marking-dependent fluid flow (setFluidFlowDependence): the flow of the mode on fluid place node is multiplied by fun(M). More...

Public Member Functions

bool is_multiclass () const
 True when any mode's arcs touch more than one class.
std::size_t single_class () const
 The one class every arc of every mode touches, 1-based; 0 when none does.
const std::vector< FluidArc > & fluid_rates (std::size_t m) const
const std::vector< FluidGuard > & fluid_guards (std::size_t m) const
const std::vector< FluidArc > & fluid_impulses (std::size_t m) const
const std::vector< FluidDep > & fluid_deps (std::size_t m) const
const std::vector< FluidFlowDep > & fluid_flow_deps (std::size_t m) const
bool has_fluid_arcs () const
 Transition.hasFluidArcs: any mode declares a fluid rate, guard, impulse, rate or flow dependence.

Static Public Member Functions

static std::vector< T > arc_total (const std::vector< Matrix< T > > &a, std::size_t m)
 The arcs of one mode summed over classes, for a consumer that is class blind BECAUSE THE NET IS SINGLE CLASS.
static std::vector< T > inhibit_total (const std::vector< Matrix< T > > &a, std::size_t m)
 The inhibiting THRESHOLD of one mode per place, class blind.

Public Attributes

std::size_t nmodes = 0
std::vector< std::string > modenames
std::vector< Matrix< T > > enabling
 enabling[m](p,r): class-r tokens of place p (0-based node) mode m needs.
std::vector< Matrix< T > > inhibiting
 inhibiting[m](p,r): class-r tokens of p that BLOCK mode m (Inf = never).
std::vector< Matrix< T > > firing
 firing[m](p,r): class-r tokens mode m moves to/from place p when it fires.
std::vector< double > nmodeservers
 servers per mode, may be infinite
std::vector< double > firingprio
 firing priority per mode
std::vector< T > fireweight
 weight among simultaneously enabled modes
std::vector< lang::TimingStrategy > timing
 immediate or timed
std::vector< lang::Distrib< T > > firingproc
 firing distribution per mode
std::vector< std::size_t > firingphases
 phase count per mode, 0 when non-Markovian
std::vector< std::function< T(const std::vector< T > &)> > firingdep
 Marking-dependent firing-rate multiplier g_m(marking); an empty entry is the unit multiplier.
std::vector< std::vector< FluidArc > > fluidrate
 FSPN arcs per mode, MATLAB sn.transparam{ind}.fluidrate/fluidguard/fluidimpulse/fluiddep.
std::vector< std::vector< FluidGuard > > fluidguard
std::vector< std::vector< FluidArc > > fluidimpulse
std::vector< std::vector< FluidDep > > fluiddep
std::vector< std::vector< FluidFlowDep > > fluidflowdep

Detailed Description

template<class T>
struct line::qn::TransitionParam< T >

The parameters of a Transition node: MATLAB sn.nodeparam{ind} for an SPN transition, as refreshPetriNetNodes.m writes them.

A transition has MODES, not classes, but its ARCS carry a class: MATLAB's enablingConditions{m} is an (nnodes x nclasses) matrix, so one mode can require two tokens of Class1 at a place while another requires one of Class2 at the same place. Each mode carries its own enabling and inhibiting conditions over the input places, its firing effect, and its own firing process – which is why State.fromMarginal treats a Transition's state as per-mode and cannot reuse the per-class station encoding.

THE CLASS DIMENSION IS NOT DECORATION. Collapsing the arcs onto the place lets a token of one class satisfy another class's pre-arc – a DIFFERENT net, not an approximation of this one. Every consumer therefore reads a (node, class) pair, and the few that are genuinely class-blind (the MDD level aggregation, the S-invariants) say so by refusing a multiclass net rather than by summing it.

Definition at line 266 of file network_struct.h.

Member Function Documentation

◆ arc_total()

template<class T>
std::vector< T > line::qn::TransitionParam< T >::arc_total ( const std::vector< Matrix< T > > & a,
std::size_t m )
inlinestatic

The arcs of one mode summed over classes, for a consumer that is class blind BECAUSE THE NET IS SINGLE CLASS.

is_multiclass() is what makes that safe, and a caller that cannot honour the class dimension must test it and refuse: the sum of a multiclass net's arcs describes a net whose tokens are interchangeable, which is not this one.

A NON-FINITE ENTRY IS SKIPPED, and a row of nothing but non-finite entries stays non-finite: on an enabling arc Inf is JMT's "any number of tokens" and on an inhibiting one it is the ABSENCE of the arc, so adding it in would turn either into a row that no marking satisfies.

Definition at line 290 of file network_struct.h.

◆ fluid_deps()

template<class T>
const std::vector< FluidDep > & line::qn::TransitionParam< T >::fluid_deps ( std::size_t m) const
inline

◆ fluid_flow_deps()

template<class T>
const std::vector< FluidFlowDep > & line::qn::TransitionParam< T >::fluid_flow_deps ( std::size_t m) const
inline

◆ fluid_guards()

template<class T>
const std::vector< FluidGuard > & line::qn::TransitionParam< T >::fluid_guards ( std::size_t m) const
inline

◆ fluid_impulses()

template<class T>
const std::vector< FluidArc > & line::qn::TransitionParam< T >::fluid_impulses ( std::size_t m) const
inline

◆ fluid_rates()

template<class T>
const std::vector< FluidArc > & line::qn::TransitionParam< T >::fluid_rates ( std::size_t m) const
inline

◆ has_fluid_arcs()

template<class T>
bool line::qn::TransitionParam< T >::has_fluid_arcs ( ) const
inline

Transition.hasFluidArcs: any mode declares a fluid rate, guard, impulse, rate or flow dependence.

Definition at line 439 of file network_struct.h.

References fluid_deps(), fluid_flow_deps(), fluid_guards(), fluid_impulses(), fluid_rates(), and nmodes.

◆ inhibit_total()

template<class T>
std::vector< T > line::qn::TransitionParam< T >::inhibit_total ( const std::vector< Matrix< T > > & a,
std::size_t m )
inlinestatic

The inhibiting THRESHOLD of one mode per place, class blind.

A threshold is not a count and does not add up: the mode is blocked as soon as ANY class reaches its own bound, so the class-blind reduction is the smallest finite threshold, and Inf where no class declares one.

Definition at line 317 of file network_struct.h.

◆ is_multiclass()

template<class T>
bool line::qn::TransitionParam< T >::is_multiclass ( ) const
inline

True when any mode's arcs touch more than one class.

Definition at line 334 of file network_struct.h.

References enabling, firing, and inhibiting.

◆ single_class()

template<class T>
std::size_t line::qn::TransitionParam< T >::single_class ( ) const
inline

The one class every arc of every mode touches, 1-based; 0 when none does.

Definition at line 354 of file network_struct.h.

References enabling, firing, and inhibiting.

Member Data Documentation

◆ enabling

◆ fireweight

template<class T>
std::vector<T> line::qn::TransitionParam< T >::fireweight

◆ firing

◆ firingdep

template<class T>
std::vector<std::function<T(const std::vector<T>&)> > line::qn::TransitionParam< T >::firingdep

Marking-dependent firing-rate multiplier g_m(marking); an empty entry is the unit multiplier.

Transition.setFiringRateDependence. The argument is the (nnodes x nclasses) marking flattened node-major, entry (i-1)*K + (r-1) for 1-based node i and class r, as MATLAB's g(M); single-class, it is node-indexed.

Definition at line 377 of file network_struct.h.

Referenced by line::qn::Network< double >::add_mode(), line::qn::after_global_event(), line::io::build_network_from_json(), line::wfn::WorkflowNet::from_network(), line::io::pnml_load(), line::io::read_jsim(), line::spn::spn_lpbnd(), and line::spn::spn_mdd().

◆ firingphases

◆ firingprio

template<class T>
std::vector<double> line::qn::TransitionParam< T >::firingprio

◆ firingproc

◆ fluiddep

◆ fluidflowdep

◆ fluidguard

◆ fluidimpulse

◆ fluidrate

template<class T>
std::vector<std::vector<FluidArc> > line::qn::TransitionParam< T >::fluidrate

FSPN arcs per mode, MATLAB sn.transparam{ind}.fluidrate/fluidguard/fluidimpulse/fluiddep.

A reader that builds the per-mode vectors itself (pnml, jsim) may leave these shorter than nmodes, so read them through the accessors below, which answer an empty list for a mode that declares nothing.

Definition at line 412 of file network_struct.h.

Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), fluid_rates(), and line::qn::Network< double >::set_mode_fluid_rate().

◆ inhibiting

◆ modenames

◆ nmodes

◆ nmodeservers

◆ timing


The documentation for this struct was generated from the following file: