![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
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>
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 |
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.
|
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.
|
inline |
Definition at line 430 of file network_struct.h.
References fluiddep.
Referenced by has_fluid_arcs(), line::io::network_to_json(), line::fluid::petri::petri_build_terms(), and line::api::sn_fluid_refusal().
|
inline |
Definition at line 434 of file network_struct.h.
References fluidflowdep.
Referenced by has_fluid_arcs(), line::io::network_to_json(), line::fluid::petri::petri_build_terms(), and line::api::sn_fluid_refusal().
|
inline |
Definition at line 422 of file network_struct.h.
References fluidguard.
Referenced by has_fluid_arcs(), line::io::network_to_json(), line::fluid::petri::petri_applicable(), line::fluid::petri::petri_build_terms(), and line::api::sn_fluid_refusal().
|
inline |
Definition at line 426 of file network_struct.h.
References fluidimpulse.
Referenced by has_fluid_arcs(), line::io::network_to_json(), line::fluid::petri::petri_build_terms(), and line::api::sn_fluid_refusal().
|
inline |
Definition at line 418 of file network_struct.h.
References fluidrate.
Referenced by has_fluid_arcs(), line::io::network_to_json(), line::fluid::petri::petri_build_terms(), and line::api::sn_fluid_refusal().
|
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.
|
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.
|
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.
|
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.
| std::vector<Matrix<T> > line::qn::TransitionParam< T >::enabling |
enabling[m](p,r): class-r tokens of place p (0-based node) mode m needs.
Definition at line 270 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::qn::Network< double >::add_transition(), line::qn::after_global_event(), line::io::build_network_from_json(), line::wfn::WorkflowNet::from_network(), is_multiclass(), line::fluid::petri::petri_build_terms(), line::io::pnml_load(), line::io::read_jsim(), line::qn::refresh_global_sync(), single_class(), line::api::sn_fluid_refusal(), line::api::sn_pn_firing_rates(), line::spn::spn_lpbnd(), line::spn::spn_mdd(), and line::spn::spn_sinvariants().
| std::vector<T> line::qn::TransitionParam< T >::fireweight |
weight among simultaneously enabled modes
Definition at line 367 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(), and line::io::read_jsim().
| std::vector<Matrix<T> > line::qn::TransitionParam< T >::firing |
firing[m](p,r): class-r tokens mode m moves to/from place p when it fires.
Definition at line 274 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::qn::Network< double >::add_transition(), line::io::build_network_from_json(), line::wfn::WorkflowNet::from_network(), is_multiclass(), line::fluid::petri::petri_build_terms(), line::io::pnml_load(), line::io::read_jsim(), line::qn::refresh_global_sync(), single_class(), line::api::sn_fluid_refusal(), line::api::sn_pn_firing_rates(), line::spn::spn_lpbnd(), line::spn::spn_mdd(), and line::spn::spn_sinvariants().
| 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().
| std::vector<std::size_t> line::qn::TransitionParam< T >::firingphases |
phase count per mode, 0 when non-Markovian
Definition at line 370 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::qn::after_event_transition(), line::qn::after_global_event(), line::io::build_network_from_json(), line::qn::from_marginal_node(), line::io::pnml_load(), line::io::read_jsim(), and line::api::sn_nonmarkov_toph().
| std::vector<double> line::qn::TransitionParam< T >::firingprio |
firing priority per mode
Definition at line 366 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), line::wfn::WorkflowNet::from_network(), line::io::pnml_load(), and line::io::read_jsim().
| std::vector<lang::Distrib<T> > line::qn::TransitionParam< T >::firingproc |
firing distribution per mode
Definition at line 369 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::qn::after_event_transition(), 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::qn::Network< double >::set_mode_fluid_dependence(), line::api::sn_fluid_refusal(), line::api::sn_has_nonmarkov(), line::api::sn_nonmarkov_toph(), line::spn::spn_lpbnd(), and line::spn::spn_mdd().
| std::vector<std::vector<FluidDep> > line::qn::TransitionParam< T >::fluiddep |
Definition at line 415 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), fluid_deps(), and line::qn::Network< double >::set_mode_fluid_dependence().
| std::vector<std::vector<FluidFlowDep> > line::qn::TransitionParam< T >::fluidflowdep |
Definition at line 416 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), fluid_flow_deps(), and line::qn::Network< double >::set_mode_fluid_flow_dependence().
| std::vector<std::vector<FluidGuard> > line::qn::TransitionParam< T >::fluidguard |
Definition at line 413 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), fluid_guards(), and line::qn::Network< double >::set_mode_fluid_guard().
| std::vector<std::vector<FluidArc> > line::qn::TransitionParam< T >::fluidimpulse |
Definition at line 414 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), fluid_impulses(), and line::qn::Network< double >::set_mode_fluid_impulse().
| 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().
| std::vector<Matrix<T> > line::qn::TransitionParam< T >::inhibiting |
inhibiting[m](p,r): class-r tokens of p that BLOCK mode m (Inf = never).
Definition at line 272 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(), is_multiclass(), line::fluid::petri::petri_build_terms(), line::io::pnml_load(), line::io::read_jsim(), line::qn::refresh_global_sync(), single_class(), line::api::sn_fluid_refusal(), line::spn::spn_lpbnd(), and line::spn::spn_mdd().
| std::vector<std::string> line::qn::TransitionParam< T >::modenames |
Definition at line 268 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::io::build_network_from_json(), line::fluid::petri::petri_applicable(), line::io::pnml_load(), line::io::read_jsim(), and line::api::sn_fluid_refusal().
| std::size_t line::qn::TransitionParam< T >::nmodes = 0 |
Definition at line 267 of file network_struct.h.
Referenced by line::qn::Network< double >::add_mode(), line::qn::Network< double >::add_transition(), line::qn::after_event_transition(), line::qn::after_global_event(), line::io::build_network_from_json(), line::qn::from_marginal_node(), has_fluid_arcs(), line::fluid::petri::petri_applicable(), line::fluid::petri::petri_build_terms(), line::io::pnml_load(), line::io::read_jsim(), line::qn::refresh_global_sync(), line::api::sn_fluid_refusal(), line::spn::spn_lpbnd(), line::spn::spn_mdd(), and line::spn::spn_sinvariants().
| std::vector<double> line::qn::TransitionParam< T >::nmodeservers |
servers per mode, may be infinite
Definition at line 365 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::qn::from_marginal_node(), line::wfn::WorkflowNet::from_network(), line::io::pnml_load(), line::io::read_jsim(), line::spn::spn_lpbnd(), and line::spn::spn_mdd().
| std::vector<lang::TimingStrategy> line::qn::TransitionParam< T >::timing |
immediate or timed
Definition at line 368 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::fluid::petri::petri_applicable(), line::io::pnml_load(), line::io::read_jsim(), line::qn::Network< double >::set_mode_fluid_dependence(), line::api::sn_fluid_refusal(), line::spn::spn_lpbnd(), and line::spn::spn_mdd().