![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
A network plus its refreshed NetworkStruct. More...
#include <line/lang/qn/network_struct.h>
Classes | |
| struct | JoinDecl |
| The DECLARED join rule of a Join node, by 1-based node index. More... | |
| struct | Reward |
| sn.reward: the user-declared reward functions, MATLAB's model.setReward(name, fn). More... | |
| struct | Region |
| FINITE CAPACITY REGIONS, MATLAB's refreshRegions output. More... | |
| struct | PasParam |
| The G-network signal declaration, per CLASS. More... | |
| struct | PollingParam |
| The polling controller of a POLLING station, keyed by station index. More... | |
Public Member Functions | |
| bool | has_service_law (std::size_t i, std::size_t r) const |
| Does (station i, class r) have a service law an analyzer may convert? | |
| const ForkParam< T > * | fork_param_of (std::size_t node) const |
| The fork's override block, or null when it declares none. | |
| bool | has_breakdown_node (std::size_t ind) const |
| sn.hasbreakdown(ind): does the NODE's server break down? | |
| bool | has_breakdown () const |
| Any station at all, the guard every solver gate needs first. | |
| PollingParam | effective_polling (std::size_t ist) const |
| The polling controller of station ist, from whichever API declared it. | |
| std::size_t | nvars_of (std::size_t ind) const |
| Total local-variable width of node ind (1-based). | |
| std::size_t | nof_stations () const |
| std::size_t | nof_classes () const |
| std::size_t | nof_nodes () const |
| std::size_t | nof_stateful () const |
| std::vector< double > | njobs () const |
| sn.njobs: the population of each class, infinite for an open one. | |
| double | nclosedjobs () const |
| sn.nclosedjobs: the total population of the closed classes. | |
| ProcessType | procid (std::size_t ist, std::size_t r) const |
| sn.procid(i,r): the process type of a (station, class) pair. | |
| std::size_t | phases_of (std::size_t ist, std::size_t r) const |
| sn.phases(i,r): the order of the process representation. | |
| std::size_t | phasessz_of (std::size_t ist, std::size_t r) const |
| sn.phasessz(i,r) = max(sn.phases(i,r),1): THE WIDTH of class r's phase block in a state row, as opposed to phases_of, which is its CONTENT. | |
| bool | has_fork () const |
| bool | has_sdr_routing () const |
| MATLAB's any(sn.isstatedep(:,3)) NARROWED TO THE ONE STRATEGY THIS PORT EVALUATES PER STATE: Krzesinski's SDR. | |
| std::vector< std::size_t > | rr_outlinks (std::size_t ind, std::size_t r) const |
| ROUND-ROBIN DISPATCH, the state that makes it deterministic. | |
| std::vector< std::size_t > | rr_weighted_outlinks (std::size_t ind, std::size_t r) const |
| The WRROBIN cycle: each outlink repeated by its weight, weight 0 once. | |
| std::size_t | rr_var_slot (std::size_t ind, std::size_t r) const |
| 1-BASED index of the pointer of (ind, r) INSIDE the node's local-variable block, or 0 when that pair does not dispatch round-robin. | |
| std::size_t | rr_dest (std::size_t ind, std::size_t r, const std::vector< T > &varrow) const |
| The destination node the pointer in VARROW names, or 0 when (ind, r) does not dispatch round-robin or the pointer is out of range. | |
| void | rr_advance (std::size_t ind, std::size_t r, std::vector< T > &varrow) const |
| Advance the pointer of (ind, r) in VARROW by one position, cyclically. | |
| bool | has_rr_routing () const |
| Whether ANY (node, class) pair dispatches round-robin. | |
| bool | has_immediate_feedback () const |
| any(sn.immfeed(:)): whether any (station, class) pair feeds back. | |
| std::size_t | node_of_station (std::size_t st) const |
| 1-based node index of a station, and the reverse; 0 when absent. | |
| std::size_t | stateful_index (std::size_t ind) const |
| 1-based stateful index of node ind, 0 when the node is not stateful. | |
| std::size_t | stateful_of_station (std::size_t st) const |
| std::size_t | add_station (const Station< T > &st) |
| Add a station, which is also a node, and grow the service table. | |
| std::size_t | add_node (const std::string &nm, NodeType ty, bool stateful) |
| Add a non-station node (a Fork, a Router). | |
| std::size_t | add_class (const JobClass &cl) |
| Add a class and grow the service table. | |
| void | set_service (std::size_t station, std::size_t cls, const Distrib< T > &d) |
| void | set_route (std::size_t r, std::size_t s, std::size_t i, std::size_t j, const T &p) |
| P{r,s}(i,j) = p, with 1-based NODE and class indices. | |
| void | set_route_effective (std::size_t r, std::size_t s, std::size_t i, std::size_t j, const T &p) |
| Write into the routing the consumers actually read. | |
| T | get_route (std::size_t r, std::size_t s, std::size_t i, std::size_t j) const |
| P{r,s}(i,j), AS THE USER SET IT. | |
| T | route_eff (std::size_t r, std::size_t s, std::size_t i, std::size_t j) const |
| The routing actually in force: the expansion when there is one, else P. | |
| void | refresh_struct () |
| The whole chain, in MATLAB's refreshStruct order. | |
| bool | holds_reply_for (std::size_t ind, std::size_t r) const |
| True when node ind (1-based) holds a server across a synchronous call whose reply class is r (1-based), i.e. | |
| bool | serves_class (std::size_t ind, std::size_t r) const |
| Whether a job of class r (0-based) can LEAVE node ind (1-based) again. | |
| std::vector< std::vector< bool > > | reached_node_classes () const |
| The (node, class) pairs a job can actually ARRIVE at, 0-based on both axes. | |
| void | check_service_reachable () const |
| Refuses a class that is ROUTED TO a station which cannot serve it. | |
| void | refresh_immfeed () |
| Port of the sn.immfeed block of @@MNetwork/refreshStruct.m. | |
| void | refresh_router_stateful () |
| Port of MNetwork.refreshLocalVars: the per-node local-variable widths. | |
| void | refresh_local_vars () |
| void | refresh_replyblock () |
| sn.replyblock, DERIVED from sn.syncreply and the routing. | |
| std::vector< std::size_t > | downstream_stations (std::size_t ind) const |
| The nodes directly downstream of ind, walking THROUGH stateless nodes and stopping at the first station on each path. | |
| void | refresh_bas_blocking () |
| Port of refreshLocalVars' true-BAS block and its declaresBlockedMarker helper: which nodes carry the blocked marker, and where a refusal blocks. | |
| void | refresh_sched_param () |
| Port of MNetwork.refreshScheduling's schedparam half. | |
| void | refresh_routing () |
| Port of the part of MNetwork.refreshRoutingMatrix this port reaches: the expansion of a routing STRATEGY into the probabilities rt is built from. | |
| std::size_t | join_siblings (std::size_t joinNode, std::size_t r=0) const |
| Port of MNetwork.refreshCapacity. | |
| std::vector< std::size_t > | quorum_joins () const |
| The 1-based Join nodes that fire on a STRICT quorum, i.e. | |
| void | refresh_capacity () |
| void | refresh_rt () |
| sn.rt and sn.rtnodes: the class-expanded routing matrices. | |
| void | refresh_cacheqn_actual_visits (const Matrix< T > &hitprob, const Matrix< T > &missprob) |
| Re-resolve the cache read self-switch from the offered 1/2-1/2 to the ACTUAL hit/miss probabilities the cacheqn decomposition converged on, then recompute rt and the visits. | |
| void | refresh_rates () |
| Port of MNetwork.refreshRates: lower each service process onto a rate and an SCV. | |
| void | refresh_chains () |
| Port of MNetwork.refreshChains followed by sn_refresh_visits. | |
| void | apply_sink_closure () |
| Route every open chain from the Sink back into the Source, as the tail of MATLAB's getRoutingMatrix does before it takes the stochastic complement. | |
| std::vector< std::size_t > | all_nodes () const |
| Every node index, 1-based, for the node-level visit computation. | |
| Matrix< T > | chain_visits (std::size_t c, const std::vector< std::size_t > &sel, bool complement, bool fork) const |
| Port of the per-chain body of sn_refresh_visits, over an arbitrary node subset – the stateful nodes for visits, all nodes for nodevisits. | |
| Matrix< T > | visits_from_block (const Matrix< T > &Pc_in, const std::vector< std::size_t > &sel, const std::vector< std::size_t > &ic, std::size_t refnode) const |
| The visit ratios of one chain from an already-formed chain routing block Pc (dim = sel.size() * nIC), the no-fork body of sn_refresh_visits: solve the embedded DTMC over the visited states and normalise by the total visits at the reference node. | |
| void | da_recompute_visits_from_rtnodes () |
| Recompute rt, visits and nodevisits after the caller has rewritten rtnodes in place – the cacheqn driver's per-sweep refresh. | |
| Matrix< T > | station_routing (const std::vector< std::size_t > &ic) const |
| The chain-restricted routing over the STATEFUL nodes: the node-level routing with the non-stateful nodes eliminated by a stochastic complement, S = P11 + P12 (I - P22)^-1 P21. | |
| Matrix< T > | stoch_comp_stateful (const Matrix< T > &full, std::size_t nIC) const |
| The stochastic complement of a NODE-level routing block over the stateful nodes, S = P11 + P12 (I - P22)^-1 P21. | |
| bool | has_open_classes () const |
| bool | is_open_model () const |
| sn_is_open_model: EVERY class is open, which is not has_open_classes. | |
| bool | has_multi_server () const |
| bool | has_fractional_populations () const |
| bool | has_class_switching () const |
| bool | has_priorities () const |
| bool | has_distinct_priorities () const |
| Whether the classes carry more than one priority level. | |
| bool | sched_has_priority_aware () const |
| Whether some station runs a discipline that READS the class priorities. | |
| bool | priorities_ignored () const |
| Priorities were declared and no station will read them. | |
| bool | has_homogeneous_scheduling (SchedStrategy) const |
| Port of sn_has_homogeneous_scheduling. | |
| bool | has_multi_class_heter_fcfs () const |
| bool | sched_is_product_form () const |
| bool | has_exponential_fcfs () const |
| BCMP type 1 asks the FCFS service to be exponential. | |
| double | buffer_size (std::size_t ist) const |
| Kendall's K of station IST (1-based), +inf when unbounded. | |
| bool | is_mm1k_loss () const |
| Implementation of api::sn_is_mm1k_loss; that free function delegates here. | |
| bool | has_blocking () const |
| Some station can REFUSE a job: its own buffer BINDS, or a finite capacity region caps a set of stations jointly. | |
| bool | has_product_form () const |
| bool | has_product_form_not_het_fcfs (bool check_means=true) const |
| Port of sn_has_product_form_not_het_fcfs: LCFS is excluded, and at FCFS the service must be exponential AND class-independent, which is what BCMP type 1 asks for. | |
| void | grow_routing () |
| Grow every routing block to the current node count. | |
| void | grow_block (Matrix< T > &B) const |
| double | total_jobs () const |
| Total population, as MATLAB's getNumberOfJobs summed. | |
Public Attributes | |
| std::string | name |
| std::string | log_path |
| Network.setLogPath / getLogPath: the directory every Logger writes into, and the logPath attribute of an exported JMT model. | |
| std::vector< NodeDef > | nodes |
| every node, in creation order | |
| std::vector< Station< T > > | stations |
| stations[k-1] is the k-th station | |
| std::vector< std::size_t > | station_to_node |
| (nstations) 1-based node index | |
| std::vector< std::size_t > | stateful_nodes |
| 1-based node indices, ascending | |
| std::vector< JobClass > | classes |
| std::vector< std::vector< Distrib< T > > > | service |
| service[i][r], 0-based station and class; a disabled entry marks a pair never visited. | |
| std::map< std::pair< std::size_t, std::size_t >, Matrix< T > > | P |
| P[(r,s)] is an (nnodes x nnodes) block; absent means all zero. | |
| std::map< std::pair< std::size_t, std::size_t >, Matrix< T > > | Peff |
| The routing after refresh_routing() has expanded the non-PROB strategies and folded the class switches in. | |
| pfqn::SdrStruct | sdr |
| Krzesinski (1987) product-form state-dependent routing, in 0-based STATION indices; empty unless a node declares it with set_state_dep_routing. | |
| pfqn::SdrStruct | sdr_nodes |
| Node-indexed twin of sdr. | |
| std::vector< std::pair< std::size_t, std::size_t > > | fj |
| fj(f,j): the Join node j that closes the Fork node f, 1-based. | |
| bool | isfjaugmented = false |
| sn.isfjaugmented: this struct came out of fj_tag, so its Fork nodes are STATEFUL and its Join nodes carry a per-class sibling count instead of the ordinary buffer/server split. | |
| std::vector< std::size_t > | fjclassmap |
| sn.fjclassmap: the ORIGINAL class of each auxiliary sibling class, 0 for an original class. | |
| std::map< std::size_t, FjJoinParam > | fjjoinparam |
| sn.nodeparam{j}.fj for each Join node: the tag matrix and the required sibling multiplicity after_event_join fires on. | |
| std::size_t | sourceIdx = 0 |
| 1-based station index of the Source, 0 = none | |
| std::size_t | sinkNode = 0 |
| 1-based NODE index of the Sink, 0 = none (it is not a station) | |
| std::map< std::size_t, CacheParam< T > > | nodeparam |
| Cache parameters by 1-based NODE index; only Cache nodes have an entry. | |
| std::map< std::size_t, std::vector< T > > | initmarking |
| The DECLARED initial state of a stateful node, by 1-based node index. | |
| std::map< std::size_t, std::vector< T > > | stateprior |
| std::map< std::size_t, Matrix< T > > | statespace |
| std::map< std::size_t, JoinDecl > | joindecl |
| std::map< std::size_t, ForkParam< T > > | forkparam |
| Variable forking levels, by 1-based Fork node; absent on a plain fork. | |
| std::vector< Reward > | reward |
| std::vector< Region > | regions |
| std::map< std::size_t, TransitionParam< T > > | transparam |
| Transition (SPN) parameters, keyed by 1-based node index. | |
| std::map< std::size_t, RetrialParam< T > > | retrialparam |
| Retrial parameters, keyed by 1-based STATION index. | |
| std::map< std::size_t, SetupDelayOffParam< T > > | setupparam |
| Setup / delay-off, keyed by 1-based STATION index. | |
| std::map< std::size_t, BreakdownParam< T > > | breakdownparam |
| Server breakdown / repair, keyed by 1-based STATION index. | |
| std::map< std::size_t, Matrix< T > > | csmatrix |
| The class-switch matrix of a ClassSwitch node, by 1-based NODE index. | |
| std::size_t | nstations = 0 |
| std::size_t | nclasses = 0 |
| std::size_t | nchains = 0 |
| GdScaling< T > | gdscaling |
| sn.gdscaling: the network-level globally state-dependent (Whittle) rate scaling phi(n). | |
| std::vector< T > | gdscalingpeak |
| sn.gdscalingpeak: the declared (nstations x nclasses) peak of gdscaling, row-major, used to report Util = T*S/peak. | |
| int | gdscalingcutoff = 10 |
| sn.gdscalingcutoff: the per-slot OPEN-class truncation used when gdscaling is materialized onto the JSON wire (closed classes are tabulated up to their own population). | |
| Matrix< T > | rates |
| (nstations x nclasses) service rates and SCVs, with a PARALLEL disabled flag instead of MATLAB's NaN sentinel. | |
| Matrix< T > | scv |
| std::vector< std::vector< bool > > | disabled |
| std::vector< std::vector< bool > > | immfeed |
| sn.immfeed: (nstations x nclasses) IMMEDIATE FEEDBACK, the reference's refreshStruct field. | |
| std::vector< std::vector< bool > > | chains |
| (nchains x nclasses) | |
| std::vector< std::vector< std::size_t > > | inchain |
| 1-based class indices per chain | |
| std::vector< std::size_t > | refclass |
| (nchains) 1-based class, 0 = none | |
| std::vector< Matrix< T > > | visits |
| (nchains) each (nstateful x nclasses) | |
| std::vector< Matrix< T > > | nodevisits |
| (nchains) each (nnodes x nclasses) | |
| std::vector< double > | cap |
| sn.cap and sn.classcap: the total and per-class buffers. | |
| std::vector< std::vector< double > > | classcap |
| std::vector< std::vector< DropStrategy > > | droprule |
| Matrix< T > | rt |
| sn.rt and sn.rtnodes: the class-expanded routing. | |
| Matrix< T > | rtnodes |
| std::vector< std::vector< std::size_t > > | nvars |
| sn.nvars, (nnodes x 3R+1): the LOCAL VARIABLE columns each node appends to its state, beyond the buffer and the servers. | |
| std::vector< bool > | isbasblocking |
| sn.isbasblocking, per NODE: true where the node is the BLOCKING (upstream) side of a true-BAS relation and therefore carries the blocked marker in nvars column 2R+1. | |
| std::vector< std::vector< bool > > | isbasdestination |
| sn.isbasdestination, (nstations x nclasses): true where a refusal at this station must BLOCK an upstream BAS station rather than drop the job. | |
| std::map< std::size_t, PasParam > | pasparam |
| std::vector< std::vector< bool > > | replyblock |
| sn.replyblock (nnodes x nclasses) and sn.syncreply (nclasses). | |
| std::vector< std::size_t > | syncreply |
| std::map< std::size_t, PollingParam > | pollingparam |
| std::vector< bool > | issignal |
| std::vector< lang::SignalType > | signaltype |
| std::vector< std::size_t > | signaltarget |
| std::vector< lang::RemovalPolicy > | signalrempolicy |
| std::vector< std::vector< T > > | signalremdist |
A network plus its refreshed NetworkStruct.
The two halves are one object because every caller that mutates the model (service processes, class populations, routing probabilities) re-derives the struct, exactly as MATLAB's Network does through its cached sn. The refresh entry points mirror the MATLAB ones and have the same granularity, which matters for cost: refresh_rates is called on every outer iteration of SolverLN for every layer, refresh_chains only where the routing changed.
Definition at line 838 of file network_struct.h.
|
inline |
Add a class and grow the service table.
Definition at line 1587 of file network_struct.h.
|
inline |
Add a non-station node (a Fork, a Router).
Returns its 1-based index.
Definition at line 1574 of file network_struct.h.
|
inline |
Add a station, which is also a node, and grow the service table.
Definition at line 1558 of file network_struct.h.
|
inline |
Every node index, 1-based, for the node-level visit computation.
Definition at line 2923 of file network_struct.h.
|
inline |
Route every open chain from the Sink back into the Source, as the tail of MATLAB's getRoutingMatrix does before it takes the stochastic complement.
WHY IT IS NOT OPTIONAL. visits is the stationary vector of the chain's routing DTMC. An open chain that ends at the Sink has no such vector – the Sink is absorbing, so the solve returns the point mass there and every station comes out with zero visits. The closing arc turns the open chain into a recurrent one whose stationary vector, renormalised by the Source, is the visit count PER ARRIVAL, which is what the chain demands are built from.
The destination class is drawn in proportion to the ARRIVAL RATES of the chain's classes, so a job leaving the Sink re-enters as the class the Source would have generated. A chain whose arrivals are all disabled has no such proportion, and the reference falls back to the uniform choice rather than dividing by zero – those chains carry no traffic and only need to stay well posed.
The arcs are rebuilt on every refresh, and the previous ones cleared first: the rates move between passes of the fork-join fixed point, and a stale arc would leave two closures with different weights in place.
Definition at line 2885 of file network_struct.h.
|
inline |
Kendall's K of station IST (1-based), +inf when unbounded.
Implementation of api/sn/sn_get_buffer_size.h, which delegates here so the solvers' member calls and the api free function cannot drift; the traps are documented on that header.
Definition at line 3562 of file network_struct.h.
|
inline |
Port of the per-chain body of sn_refresh_visits, over an arbitrary node subset – the stateful nodes for visits, all nodes for nodevisits.
The FORK CORRECTIONS are the reference's, and they are blunt on purpose. A Fork row sums to its fan-out rather than to one, so the rows are renormalised before the DTMC solve; afterwards, rather than trusting the resulting stationary vector, a population-preserving SPN argument sets EVERY visited entry to 1 (and a Join entry to its in-degree, one per incoming branch). Reproduced exactly: the corrected visits are what the chain demands are built from, so an "improved" version would disagree with every other codebase.
Definition at line 2942 of file network_struct.h.
|
inline |
Refuses a class that is ROUTED TO a station which cannot serve it.
The reference's sanitize disables the OUTGOING routing of a class a station cannot serve, which is what keeps it out of that station's visit ratios – but nothing stopped the class being routed IN, and a class that arrives where it cannot be served is a flow sink: it enters and never leaves. The station-level guard next to it cannot see this, because it asks whether the station serves ANY class, not whether it serves the classes that reach it.
One such model gave three different wrong answers, none flagged, on a closed cycle D <-> Q whose class C2 has no service at Q: MVA reported Q/C2 with ArvR 1 against Tput 0, CTMC dropped C2 entirely, and SSA returned D/C2 QLen 2e-06 with the Q rows absent.
READS rtnodes, WALKED FORWARD FROM THE FEED POINTS – not nodevisits, which this guard read until 2026-09-02 and which 94d5570f3 had made blind to the very case it exists for. That commit extended the served mask from the station chain to the NODE chain, and it had to: on a materialised LQN replica the unserved states close into a spurious cycle. But the mask zeroes exactly the (station, class) cell a flow sink shows up in. On Source -> Q -> Sink with class B unservable at Q, B's chain went from Q = 1 to Q = 0 and the guard fell silent, while the Sink still read 1 – flow arriving downstream of a node it never visited. A MASKED VISIT VECTOR CANNOT ANSWER THIS QUESTION, because the mask IS the answer being looked for. Do not route this guard back through nodevisits or visits; both carry that mask. See _kb/07-cross-language-parity.md.
rtnodes on its own over-approximates – it says where a class WOULD go if one existed – and the WALK is what removes the slack. It starts only at (Source, class) pairs whose arrival process is not DISABLED, and at the reference station of each closed class with a positive population, so the disabled-arrival row a class-switching Source carries is never entered. Three rules keep it honest: a Sink is ABSORBING (rtnodes wraps it back to the Source to close the kernel, and following that wrap re-enters every Source row, including the disabled ones the seeding just excluded); a Source is expanded ONLY AS A SEED, for the same reason; and an unservable (station, class) is REACHED BUT NOT EXPANDED, since nothing leaves it – that is the whole complaint – so nothing downstream of it is evidence of anything.
This SUBSUMES the fed-chain precondition the guard used to carry separately: a chain no job can enter has no seed, so its rows are never walked at all. That is strictly finer than the per-chain test it replaces, which admitted every class of a chain any one of whose classes was fed.
Definition at line 1841 of file network_struct.h.
|
inline |
Recompute rt, visits and nodevisits after the caller has rewritten rtnodes in place – the cacheqn driver's per-sweep refresh.
rt is the stochastic complement of rtnodes over the stateful (node, class) rows; the per-chain visits then read directly off rt (stateful) and rtnodes (all nodes), with the chains held FIXED (the reference does not recompute them inside the sweep). No-fork only; a fork keeps the refresh path.
Definition at line 3264 of file network_struct.h.
|
inline |
The nodes directly downstream of ind, walking THROUGH stateless nodes and stopping at the first station on each path.
downstreamStations in refreshLocalVars.m. A blocked job is held for its IMMEDIATE destination, so the walk stops at the first station: a Router or ClassSwitch in between is a routing decision, not a place to wait.
The reference reads sn.connmatrix; this port has no such field and reads rtnodes instead, which is the same graph after the refresh has resolved the routing strategies. The two differ only on a link the model declares and then routes zero mass over, and such a link cannot fill a destination, so it cannot block anything either.
Definition at line 2075 of file network_struct.h.
|
inline |
The polling controller of station ist, from whichever API declared it.
TWO APIS WRITE THE SAME CONTROLLER. set_polling fills pollingparam; Queue.setPollingType / Queue.setSwitchover – the MATLAB-faithful pair the JSON reader also uses – fill Station::polling_type, switchover and polling_par. Reading only the first left a station built the second way with NO controller at all, which is not a degraded model but an unrepresentable one: the state handlers then index an empty polled.
A POLLING station that declares neither still HAS a controller, exactly as State.pollingInfo builds one: EXHAUSTIVE service, every switchover immediate. That is a discipline, not an absence.
Definition at line 1275 of file network_struct.h.
|
inline |
The fork's override block, or null when it declares none.
Definition at line 968 of file network_struct.h.
|
inline |
P{r,s}(i,j), AS THE USER SET IT.
Every consumer of the routing reads route_eff() instead, which is this matrix once refresh_routing() has expanded the strategies that are not literal probabilities. The two agree on a model whose routing is entirely PROB, which is every model the LN layer builder produces.
Definition at line 1643 of file network_struct.h.
|
inline |
Definition at line 3699 of file network_struct.h.
|
inline |
Grow every routing block to the current node count.
Definition at line 3696 of file network_struct.h.
|
inline |
Some station can REFUSE a job: its own buffer BINDS, or a finite capacity region caps a set of stations jointly.
Implementation of api::sn_has_blocking, which delegates here; the rule and its two exemptions are documented on that function.
Definition at line 3613 of file network_struct.h.
|
inline |
Any station at all, the guard every solver gate needs first.
Definition at line 1063 of file network_struct.h.
|
inline |
sn.hasbreakdown(ind): does the NODE's server break down?
Definition at line 1057 of file network_struct.h.
|
inline |
Definition at line 3436 of file network_struct.h.
|
inline |
Whether the classes carry more than one priority level.
NOT has_priorities(), which asks whether any priority is nonzero: a model whose classes all sit at level 1 has priorities by that test and nothing to distinguish, and the reference's warning below keys on the distinction rather than on the magnitude.
Definition at line 3452 of file network_struct.h.
|
inline |
BCMP type 1 asks the FCFS service to be exponential.
has_multi_class_heter_fcfs compares the class MEANS only, so a class-homogeneous Erlang, hyper-exponential or deterministic FCFS station used to pass this gate and be dispatched to exact MVA, which reads the means alone and returns the exponential answer with no warning.
Definition at line 3544 of file network_struct.h.
|
inline |
Definition at line 1383 of file network_struct.h.
|
inline |
Definition at line 3429 of file network_struct.h.
|
inline |
Port of sn_has_homogeneous_scheduling.
The MATLAB function is length(findstring(sn.sched, strategy)) == sn.nstations, and findstring matches STRINGS: on the numeric sched vector its strcmp is false, so it returns the sentinel -1, whose length is 1. The predicate therefore reduces to nstations == 1 whatever the disciplines are, which is what the reference actually computes and what the AMVA dispatch in solver_amva actually sees. Reproduced rather than corrected: fixing it here would send homogeneous-delay layers down a different branch than every other codebase takes.
Definition at line 3506 of file network_struct.h.
|
inline |
any(sn.immfeed(:)): whether any (station, class) pair feeds back.
Definition at line 1529 of file network_struct.h.
|
inline |
Definition at line 3508 of file network_struct.h.
|
inline |
Definition at line 3423 of file network_struct.h.
|
inline |
Definition at line 3405 of file network_struct.h.
|
inline |
Definition at line 3438 of file network_struct.h.
|
inline |
Definition at line 3623 of file network_struct.h.
|
inline |
Port of sn_has_product_form_not_het_fcfs: LCFS is excluded, and at FCFS the service must be exponential AND class-independent, which is what BCMP type 1 asks for.
With unequal per-class means the product-form solve returns a wait proportional to each class's own demand where FCFS makes every class wait behind the same queue. The mean comparison is between CHAIN service times (visit-weighted over the classes that actually visit the station): a class that never visits cannot break product form, and within-chain heterogeneity is invisible to both the product-form and the qd branch, which deaggregate a chain result proportionally to each class's own demand, so only between-chain heterogeneity warrants the divert. LN layers carry seeded rates for classes with zero visits, which a raw per-class comparison mistakes for heterogeneity.
CHECK_MEANS drops the mean test; pass false only for an algorithm that models class-dependent FCFS itself (ab, schmidt, schmidt-ext).
Definition at line 3647 of file network_struct.h.
|
inline |
Whether ANY (node, class) pair dispatches round-robin.
Definition at line 1521 of file network_struct.h.
|
inline |
MATLAB's any(sn.isstatedep(:,3)) NARROWED TO THE ONE STRATEGY THIS PORT EVALUATES PER STATE: Krzesinski's SDR.
RROBIN, WRROBIN, JSQ and SQ are state dependent too and sn_has_sd_routing reports them, but their per-state tables need auxiliary state this port does not carry (a round-robin pointer) or are refused outright, so a generator asking "must I re-evaluate the routing at every state?" must ask this, not that.
Definition at line 1398 of file network_struct.h.
|
inline |
Does (station i, class r) have a service law an analyzer may convert?
0-based, and the ONLY correct precondition for dist_to_map(service[i][r]).
disabled alone is not enough, and the gap is not hypothetical. It is the twin of MATLAB's NaN-in-sn.rates sentinel, so it answers "does the class visit this station". A JOIN is visited – refreshRates gives it rates = Inf, scv = 0 – and yet it has NO service law: refreshProcessRepresentations hands it a Coxian(NaN,NaN), which every MATLAB analyzer then skips through a SECOND and separate any(isnan(D0)) guard. Rational has no NaN, so the C++ twin of that Coxian is a DISABLED Distrib, and a guard that tests only disabled[i][r] || rates <= 0 sails past a Join (Inf > 0) straight into dist_to_map, which throws "the distribution is disabled" with no station named. fj_basic_open failed exactly this way under -s mam.
So: disabled[i][r] is about the VISIT, service[i][r].disabled is about the LAW, and a station can be visited without having one.
Definition at line 877 of file network_struct.h.
|
inline |
True when node ind (1-based) holds a server across a synchronous call whose reply class is r (1-based), i.e.
r returns here to release a server rather than to be served by one.
Definition at line 1701 of file network_struct.h.
|
inline |
Implementation of api::sn_is_mm1k_loss; that free function delegates here.
Definition at line 3580 of file network_struct.h.
|
inline |
sn_is_open_model: EVERY class is open, which is not has_open_classes.
A mixed model passes that predicate and fails this one, and an analyzer that confuses the two hands a closed chain to a solver with no level for its population. An empty class list is not an open model either.
Definition at line 3417 of file network_struct.h.
|
inline |
Port of MNetwork.refreshCapacity.
classcap(i,r) is the population of r's CHAIN, cut down by any explicit per-class or per-station buffer, and 0 where the class does not visit the station; cap(i) is the explicit station buffer when there is one, and otherwise the smaller of the chain and class sums.
chaincap IS K COLUMNS WIDE, NOT nchains, exactly as the reference sizes it (chaincap = Inf*ones(M,K)). The last class of a chain wins the write, so a chain with a class disabled at station i can leave chaincap(i,c) at 0; under class switching, where nchains < K, the untouched columns stay Inf and carry the sum, which is what stops that 0 from capping a station that holds the whole chain population at nothing.
The derived drop rule follows the reference exactly, including that WAITQ means "never consulted" at an unbounded station and "unsettled" for a closed class at a bounded one: only an OPEN class at a real finite buffer gets DROP.
A PLACE IS EXEMPT FROM THE ZEROING. disabled is this port's marker for the reference's isnan(sn.rates(i,r)), and a Place holds a marking rather than serving, so it has no service process and every class reads as disabled there. Zeroing it leaves a token container that cannot hold a token: cap and classcap both come out 0, JMT is handed a Storage section of capacity 0, and the net is dead on arrival. refreshCapacity.m carries the same ~= NodeType.Place guard on its isnan test. The number of siblings the fork-join pair ending at Join node joinNode (1-based) emits per parent job: the matched Fork's out-degree times its tasksPerLink, with the Join's in-degree as the fallback when no Fork is matched. Port of matlab/src/api/fj/sn_join_siblings.m.
Read off the DECLARED routing P rather than off rtnodes, because refresh_capacity asks this question and runs BEFORE refresh_rt. The two differ only on a declared link that carries no mass, which forks no sibling either.
Definition at line 2470 of file network_struct.h.
|
inline |
sn.nclosedjobs: the total population of the closed classes.
Definition at line 1323 of file network_struct.h.
|
inline |
sn.njobs: the population of each class, infinite for an open one.
Definition at line 1315 of file network_struct.h.
|
inline |
1-based node index of a station, and the reverse; 0 when absent.
1-based node index of station st, 0 when the map has no entry.
Definition at line 1537 of file network_struct.h.
|
inline |
Definition at line 1310 of file network_struct.h.
|
inline |
Definition at line 1311 of file network_struct.h.
|
inline |
Definition at line 1312 of file network_struct.h.
|
inline |
Definition at line 1309 of file network_struct.h.
|
inline |
Total local-variable width of node ind (1-based).
Definition at line 1298 of file network_struct.h.
|
inline |
sn.phases(i,r): the order of the process representation.
A PLACE HOLDS TOKENS IN ONE PHASE, and that is not cosmetic. MATLAB's refreshProcessRepresentations decides the count from what ph{ist}{r} turned out to be, and it has TWO ways of having no service:
The cost was total: from_marginal_node_first can build no row for a node with 0 phases, so default_init_state failed on EVERY Place and every closed SPN was refused with "the model's initial marking admits no state" – spn_inhibiting, spn_basic_closed and spn_fourmodes alike, under a message about Place populations that were in fact correct.
A QUEUEING Place is untouched: it has a real server and a real law, so it is not disabled and answers from its representation as before.
Definition at line 1352 of file network_struct.h.
|
inline |
sn.phasessz(i,r) = max(sn.phases(i,r),1): THE WIDTH of class r's phase block in a state row, as opposed to phases_of, which is its CONTENT.
The two differ exactly where a class is disabled at a station, and the reference keeps the column anyway: a disabled process is stored as a 1 x 1 NaN, never as an empty, so length(sn.proc{ist}{r}{1}) is 1 and State.fromMarginal emits one always-zero column for it. A Source serving one of six classes therefore writes [Inf 1 0 0 0 0 0], and this port used to write [Inf 1].
The narrow row is internally consistent, so it is invisible until it CROSSES A BRIDGE: a model.json exported by MATLAB carries the wide row, and decoding it against a narrow layout put the arrival one-hot in another class's column. solver_ssa_serial then walked into a state with no enabled transition and reported a deadlock rather than a refusal.
Use this wherever a WIDTH or an OFFSET is computed – row_layout, to_marginal, every from_marginal* builder – and phases_of wherever the question is whether the class has a process at all, or how many real phases it has to iterate over.
Definition at line 1379 of file network_struct.h.
|
inline |
Priorities were declared and no station will read them.
Definition at line 3490 of file network_struct.h.
|
inline |
sn.procid(i,r): the process type of a (station, class) pair.
Definition at line 1326 of file network_struct.h.
|
inline |
The 1-based Join nodes that fire on a STRICT quorum, i.e.
on FEWER siblings than are forked. A model holding one is not population-conserving at the sibling level: the join releases the parent at the k-th of n siblings and the n-k stragglers stay in their branches, so the parent forks again while they are still in flight.
Definition at line 2538 of file network_struct.h.
|
inline |
The (node, class) pairs a job can actually ARRIVE at, 0-based on both axes.
A forward walk of rtnodes from the feed points. See check_service_reachable for why the evidence is the UNMASKED routing kernel rather than nodevisits, and for the three rules – absorbing Sink, Source expanded only as a seed, unservable pair reached but not expanded – that keep the walk from over-approximating.
Returns an empty vector when rtnodes is not the expected (N*K) square, which leaves the caller checking nothing, exactly as before.
Definition at line 1743 of file network_struct.h.
|
inline |
Port of refreshLocalVars' true-BAS block and its declaresBlockedMarker helper: which nodes carry the blocked marker, and where a refusal blocks.
Definition at line 2110 of file network_struct.h.
|
inline |
Re-resolve the cache read self-switch from the offered 1/2-1/2 to the ACTUAL hit/miss probabilities the cacheqn decomposition converged on, then recompute rt and the visits.
The runner reads ArvR and ResidT off the result, matching MATLAB whose sn.visits carry the actual (setResultHitProb) split, not the offered one. Served metrics are unaffected: they come from the analyzer's own over-routed inner solve. hitprob/missprob are (ncaches x nclasses), indexed by cache order and input class, exactly as da_cacheqn returns them.
Definition at line 2694 of file network_struct.h.
|
inline |
Definition at line 2551 of file network_struct.h.
|
inline |
Port of MNetwork.refreshChains followed by sn_refresh_visits.
The class-switch mask is (r == s) or "some link carries r into s", which is what link() records in csMatrix and what refreshChains then re-derives from rt; the chains are the connected components of that mask read as an undirected graph. MATLAB orders the chains by sortrows(...,'descend') on the indicator rows, which for disjoint components is the same as ordering by their smallest class index, and that is what is done here.
Definition at line 2759 of file network_struct.h.
|
inline |
Port of the sn.immfeed block of @@MNetwork/refreshStruct.m.
The station's own per-class setting OR the class-level one, which is the reference's stationHas || classHas. Sized here rather than in refresh_rates because it is a property of the model's topology and not of the service processes, so it must not be cleared when only the rates are re-derived (SolverLN calls refresh_rates per layer, per iteration).
Definition at line 1894 of file network_struct.h.
|
inline |
Definition at line 1939 of file network_struct.h.
|
inline |
Port of MNetwork.refreshRates: lower each service process onto a rate and an SCV.
A disabled (station, class) pair becomes NaN, which is the marker every downstream consumer keys on to mean "this class never visits here".
Definition at line 2724 of file network_struct.h.
|
inline |
sn.replyblock, DERIVED from sn.syncreply and the routing.
Port of refreshLocalVars.m:340-386. A server is held wherever the REPLY class can arrive: every node that is a station, is not the Source, and is not an infinite server – an INF station has a server per job, so holding one is immaterial and needs no state. Every such station must be FCFS, because a held server is encoded as a per-class COUNTER, which is exact only where the servers are interchangeable.
Derived rather than declared because the model layer carries only the class-to-class binding (JobClass.setReplySignalClass), and a caller naming the nodes itself would silently disagree with the reference on any model whose routing sends the reply somewhere it did not think of.
Definition at line 2022 of file network_struct.h.
|
inline |
Port of MNetwork.refreshLocalVars: the per-node local-variable widths.
A column is reserved only where the model actually needs one, because the width is part of the state encoding – a spurious column widens every state row and makes it unmatchable against the enumerated space. A Router that DISPATCHES ROUND-ROBIN holds state, so it must survive the stochastic complement that removes the stateless nodes.
The reference makes EVERY Router stateful (refreshStruct.m:155); this port promotes only the dispatching ones, because a PROB or RAND Router genuinely holds nothing and complementing it away is both correct and cheaper – it keeps the state space of every existing model unchanged. The promotion happens at refresh rather than at add_router, since set_routing is called after the node exists.
Definition at line 1923 of file network_struct.h.
|
inline |
Port of the part of MNetwork.refreshRoutingMatrix this port reaches: the expansion of a routing STRATEGY into the probabilities rt is built from.
PROB is already probabilities and is copied through. RAND and RROBIN spread the mass uniformly over the nodes the user connected this one to, which is what MATLAB's RoutingStrategy.RAND means once link has recorded the connections, and what getRoutingMatrix.m:117 does for both in the same branch: a round-robin pointer visits every outgoing link equally often, so the ROUTING PROBABILITIES it induces are uniform and only the higher moments of the split are deterministic. Recovering that determinism is the consumer's job – npfqn_traffic_split_rr gives QNA and MNA the split degree, and a solver that needs the pointer itself must carry it in the state. A solver that does neither must not declare RoutingStrategy_RROBIN in its feature set, or it answers a random- routing model under a round-robin name. A ClassSwitch node's outgoing mass is multiplied by its class-switch matrix, so a job leaving it in class r continues as class s with probability C(r,s) – the node itself is not stateful, and the stochastic complement folds it into the edges around it.
Every other strategy is state dependent (WRROBIN, JSQ, SQ, FIRING) and is REFUSED by name: silently treating one as PROB returns a product-form answer for a model that does not have one. WRROBIN is not RROBIN with weights for this purpose – its uniform expansion would be wrong even in the first moment.
Definition at line 2253 of file network_struct.h.
|
inline |
sn.rt and sn.rtnodes: the class-expanded routing matrices.
rtnodes is the routing over every node; rt is its stochastic complement over the stateful ones, which is the same construction the per-chain visits use – but over ALL classes at once rather than one chain at a time, because that is what sn.rt means and what solver_qna reads.
Definition at line 2670 of file network_struct.h.
|
inline |
Port of MNetwork.refreshScheduling's schedparam half.
DPS and GPS take a per-class weight, defaulting to 1; SEPT and LEPT take the rank of the class's mean service time among the distinct means, which is what the reference computes here rather than at the solver.
EVERY OTHER DISCIPLINE DEFAULTS TO 1, NOT 0. Measured against MATLAB R2025a: FCFS, PS, LPS, SIRO, LCFS, HOL and SJF all report schedparam 1 per class on a two-class model, and only SEPT/LEPT differ. Defaulting to zero here made every consumer that normalizes by the weight total divide 0/0: a load-dependent PS station reported Util exactly 0 against the reference's 0.400822578299582, and ctmc_signal_busy shares the pattern.
Definition at line 2196 of file network_struct.h.
|
inline |
The whole chain, in MATLAB's refreshStruct order.
The order is load bearing: the routing expansion must precede the chains (they are read off the class-switch structure of the routing), the chains must precede the capacities (a station's buffer is bounded by the population of the chains that reach it), and the visits must precede nothing but must follow the sink closure, which needs the chains.
Definition at line 1670 of file network_struct.h.
|
inline |
The routing actually in force: the expansion when there is one, else P.
Definition at line 1650 of file network_struct.h.
|
inline |
Advance the pointer of (ind, r) in VARROW by one position, cyclically.
A no-op where the pair does not dispatch round-robin, so a caller can run it unconditionally on every departure.
Definition at line 1499 of file network_struct.h.
|
inline |
The destination node the pointer in VARROW names, or 0 when (ind, r) does not dispatch round-robin or the pointer is out of range.
| varrow | the node's local-variable columns, as after_event slices them |
Definition at line 1482 of file network_struct.h.
|
inline |
ROUND-ROBIN DISPATCH, the state that makes it deterministic.
A round-robin dispatcher is not a coin: which link the next job takes is decided by a POINTER the node carries between departures, and without it refresh_routing's uniform expansion answers a random-routing model under a dispatcher's name. The pointer lives in the node's local-variable block, one column per class that routes RROBIN or WRROBIN (refresh_local_vars allocates it as nvars[ind-1][R+r-1]).
RROBIN stores the DESTINATION NODE INDEX in its slot; WRROBIN stores a POSITION in the weighted cycle, because a repeated outlink must advance once per repetition and a destination value could not tell the copies apart. Both are the reference's encodings (refreshLocalVars.m:318-355, afterEventStation.m:632-658, afterEventRouter.m:22-52).
Definition at line 1420 of file network_struct.h.
|
inline |
1-BASED index of the pointer of (ind, r) INSIDE the node's local-variable block, or 0 when that pair does not dispatch round-robin.
sum(nvars(ind, 1:(R+class))), which counts over the phase columns first: the reference indexes space_var with exactly that, and reading the pointer as "the r-th trailing column" instead is wrong the moment a class carries a modulating phase or only some classes dispatch.
Definition at line 1462 of file network_struct.h.
|
inline |
The WRROBIN cycle: each outlink repeated by its weight, weight 0 once.
Definition at line 1434 of file network_struct.h.
|
inline |
Whether some station runs a discipline that READS the class priorities.
The list is exactly the *PRIO family. Priority-awareness is a property of the DECLARED policy and is never inferred from the data: a base policy is not upgraded because the classes it was handed carry unequal priorities. afterEventStation did infer it once, and plain LCFS with distinct priorities then behaved as none of the three policies involved.
Definition at line 3468 of file network_struct.h.
|
inline |
Definition at line 3529 of file network_struct.h.
|
inline |
Whether a job of class r (0-based) can LEAVE node ind (1-based) again.
True for anything that is not a service station, and for a station that serves r, declares heterogeneous server types (its per-class process is disabled by construction there) or holds a server across a synchronous call whose reply class is r. False only for the flow sink itself, which is what stops the walk in reached_node_classes – the same three exemptions the guard applies, kept in one place so the walk and the verdict cannot drift apart.
Definition at line 1720 of file network_struct.h.
|
inline |
P{r,s}(i,j) = p, with 1-based NODE and class indices.
Definition at line 1598 of file network_struct.h.
|
inline |
Write into the routing the consumers actually read.
The Sink -> Source closure is derived by the refresh, not given by the user, so it belongs in the effective routing; writing it into P alone would make it invisible on any model whose routing was expanded.
Definition at line 1615 of file network_struct.h.
|
inline |
Definition at line 1593 of file network_struct.h.
|
inline |
1-based stateful index of node ind, 0 when the node is not stateful.
Definition at line 1544 of file network_struct.h.
|
inline |
Definition at line 1550 of file network_struct.h.
|
inline |
The chain-restricted routing over the STATEFUL nodes: the node-level routing with the non-stateful nodes eliminated by a stochastic complement, S = P11 + P12 (I - P22)^-1 P21.
That is MATLAB's dtmc_stochcomp, and it is what removes a Fork (and, there, the auto-added ClassSwitch nodes) from the visit equations.
Definition at line 3317 of file network_struct.h.
|
inline |
The stochastic complement of a NODE-level routing block over the stateful nodes, S = P11 + P12 (I - P22)^-1 P21.
Split out of station_routing because the STATE-DEPENDENT routing table (rt_state, state.h) is the same complement of a block whose SDR rows have been re-evaluated at one state: the two must eliminate the stateless nodes identically, or the per-state table and rt would disagree on a model that merely has a Router in it.
| full | node-major (nnodes * nIC) square block |
| nIC | number of classes carried per node in that block |
Definition at line 3343 of file network_struct.h.
|
inline |
Total population, as MATLAB's getNumberOfJobs summed.
Definition at line 3708 of file network_struct.h.
|
inline |
The visit ratios of one chain from an already-formed chain routing block Pc (dim = sel.size() * nIC), the no-fork body of sn_refresh_visits: solve the embedded DTMC over the visited states and normalise by the total visits at the reference node.
NaN entries (a Cache class switch can leave one) are given the row's residual probability spread uniformly, as the reference does. Fork models keep the route_eff path (chain_visits); this is used by the cacheqn driver, which rewrites rtnodes directly and has no fork.
Definition at line 3185 of file network_struct.h.
| std::map<std::size_t, BreakdownParam<T> > line::qn::NetworkStruct< T >::breakdownparam |
Server breakdown / repair, keyed by 1-based STATION index.
Presence IS MATLAB's sn.hasbreakdown(node), which the reference sets from ~isempty(node.breakdownFailure) && ~isempty(node.breakdownRepair) – BOTH, since a server that fails and is never repaired is a different model and the reference declines to infer one.
Definition at line 1054 of file network_struct.h.
| std::vector<double> line::qn::NetworkStruct< T >::cap |
sn.cap and sn.classcap: the total and per-class buffers.
Derived by refresh_capacity() from the station capacities and the chain populations, exactly as MATLAB's refreshCapacity does, so a station with no explicit capacity still carries the population bound of the chains that reach it.
Definition at line 1140 of file network_struct.h.
| std::vector<std::vector<bool> > line::qn::NetworkStruct< T >::chains |
(nchains x nclasses)
Definition at line 1126 of file network_struct.h.
| std::vector<std::vector<double> > line::qn::NetworkStruct< T >::classcap |
Definition at line 1141 of file network_struct.h.
| std::vector<JobClass> line::qn::NetworkStruct< T >::classes |
Definition at line 854 of file network_struct.h.
| std::map<std::size_t, Matrix<T> > line::qn::NetworkStruct< T >::csmatrix |
The class-switch matrix of a ClassSwitch node, by 1-based NODE index.
(nclasses x nclasses), row-stochastic. It is applied on the way OUT of the node, exactly as MATLAB's ClassSwitch does, and the node is not stateful, so the stochastic complement folds it into the edges around it.
Definition at line 1071 of file network_struct.h.
| std::vector<std::vector<bool> > line::qn::NetworkStruct< T >::disabled |
Definition at line 1106 of file network_struct.h.
| std::vector<std::vector<DropStrategy> > line::qn::NetworkStruct< T >::droprule |
Definition at line 1142 of file network_struct.h.
| std::vector<std::pair<std::size_t, std::size_t> > line::qn::NetworkStruct< T >::fj |
fj(f,j): the Join node j that closes the Fork node f, 1-based.
Definition at line 904 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::fjclassmap |
sn.fjclassmap: the ORIGINAL class of each auxiliary sibling class, 0 for an original class.
Empty unless isfjaugmented.
Definition at line 920 of file network_struct.h.
| std::map<std::size_t, FjJoinParam> line::qn::NetworkStruct< T >::fjjoinparam |
sn.nodeparam{j}.fj for each Join node: the tag matrix and the required sibling multiplicity after_event_join fires on.
Declared as an opaque map here and defined in fj_tag.h, which owns its layout.
Definition at line 926 of file network_struct.h.
| std::map<std::size_t, ForkParam<T> > line::qn::NetworkStruct< T >::forkparam |
Variable forking levels, by 1-based Fork node; absent on a plain fork.
Definition at line 965 of file network_struct.h.
| GdScaling<T> line::qn::NetworkStruct< T >::gdscaling |
sn.gdscaling: the network-level globally state-dependent (Whittle) rate scaling phi(n).
Its argument is the FULL (nstations x nclasses) population matrix in row-major order, NOT one station's slice, so unlike Station::jdscaling it lives on the struct rather than on a station. Empty when the model declares none. See set_global_dependence.
Definition at line 1082 of file network_struct.h.
| int line::qn::NetworkStruct< T >::gdscalingcutoff = 10 |
sn.gdscalingcutoff: the per-slot OPEN-class truncation used when gdscaling is materialized onto the JSON wire (closed classes are tabulated up to their own population).
Solving ignores it entirely.
Definition at line 1093 of file network_struct.h.
| std::vector<T> line::qn::NetworkStruct< T >::gdscalingpeak |
sn.gdscalingpeak: the declared (nstations x nclasses) peak of gdscaling, row-major, used to report Util = T*S/peak.
Definition at line 1087 of file network_struct.h.
| std::vector<std::vector<bool> > line::qn::NetworkStruct< T >::immfeed |
sn.immfeed: (nstations x nclasses) IMMEDIATE FEEDBACK, the reference's refreshStruct field.
A job of class r completing at station i is fed straight back into service, HOLDING THE SERVER, instead of being routed out and re-queued. The flag is the OR of the station's own setting (Queue only) and the class-level one, exactly as MATLAB @@MNetwork/refreshStruct.m computes it, so either spelling reaches the same matrix.
IT IS NOT A Feature, deliberately. feature_name is byte-for-byte the MATLAB registry field name, and the reference has no such entry: MVA and NC WARN that they approximate it as class-switching with re-queueing, while CTMC and SSA implement the sample-path semantics. Making it a feature would invent a name no other codebase carries and would turn the reference's warning into a refusal.
Definition at line 1125 of file network_struct.h.
| std::vector<std::vector<std::size_t> > line::qn::NetworkStruct< T >::inchain |
1-based class indices per chain
Definition at line 1127 of file network_struct.h.
| std::map<std::size_t, std::vector<T> > line::qn::NetworkStruct< T >::initmarking |
The DECLARED initial state of a stateful node, by 1-based node index.
initmarking is a Place's token count per class, which is the initial marking of an SPN and is not derivable from anything else – an SPN with no tokens anywhere is a dead net, so dropping it changes the answer to "nothing ever fires". stateprior and statespace are the pair MATLAB writes together (StatefulNode.statePrior over StatefulNode.space): the prior is a distribution over the ROWS of that space, so neither is meaningful without the other and the reader refuses a lone one.
Definition at line 946 of file network_struct.h.
| std::vector<bool> line::qn::NetworkStruct< T >::isbasblocking |
sn.isbasblocking, per NODE: true where the node is the BLOCKING (upstream) side of a true-BAS relation and therefore carries the blocked marker in nvars column 2R+1.
TRUE BAS is not a drop rule, it is a HELD JOB. Under blocking after service the job that finished at this station cannot leave because its destination is full; it stays at the server, occupying it, until room frees. That needs a state bit – "the front job here is completed and waiting" – which no queue length can express, and it is what separates BAS from DROP (where the arrival is lost) and from WAITQ (where the arrival waits at the region gate instead).
IT IS KEYED ON THE NODE, NOT ON THE DROP RULE, and the distinction is load-bearing. BAS may be DECLARED on either side: upstream, on the station that will hold the job, or on the full destination (the JMT/LDES convention). Both resolve to the same blocking station, because the held job sits upstream either way, so keying enumeration on the station's own droprule misses every destination-declared model.
Definition at line 1193 of file network_struct.h.
| std::vector<std::vector<bool> > line::qn::NetworkStruct< T >::isbasdestination |
sn.isbasdestination, (nstations x nclasses): true where a refusal at this station must BLOCK an upstream BAS station rather than drop the job.
arrival_is_lost needs it because it sees only the station where the refusal happens. Under the upstream declaration form that station carries no BAS rule of its own, so without this mask an open class refused there would be declared lost, the become-blocked edge would never fire, and the blocking station would behave as if its destination were unbounded.
Definition at line 1204 of file network_struct.h.
| bool line::qn::NetworkStruct< T >::isfjaugmented = false |
sn.isfjaugmented: this struct came out of fj_tag, so its Fork nodes are STATEFUL and its Join nodes carry a per-class sibling count instead of the ordinary buffer/server split.
It is a flag and not an inference from fj being non-empty, because the un-augmented struct of the SAME model also has fj populated: what distinguishes them is the auxiliary class block, and the event layer must not take the Join branch before it exists.
Definition at line 915 of file network_struct.h.
| std::vector<bool> line::qn::NetworkStruct< T >::issignal |
Definition at line 1291 of file network_struct.h.
| std::map<std::size_t, JoinDecl> line::qn::NetworkStruct< T >::joindecl |
Definition at line 962 of file network_struct.h.
| std::string line::qn::NetworkStruct< T >::log_path |
Network.setLogPath / getLogPath: the directory every Logger writes into, and the logPath attribute of an exported JMT model.
Model-level rather than per-Logger because that is where the reference keeps it – Logger's constructor REFUSES when it is unset – and because the JSIM header carries one such path for the whole model.
Definition at line 849 of file network_struct.h.
| std::string line::qn::NetworkStruct< T >::name |
Definition at line 840 of file network_struct.h.
| std::size_t line::qn::NetworkStruct< T >::nchains = 0 |
Definition at line 1074 of file network_struct.h.
| std::size_t line::qn::NetworkStruct< T >::nclasses = 0 |
Definition at line 1074 of file network_struct.h.
| std::map<std::size_t, CacheParam<T> > line::qn::NetworkStruct< T >::nodeparam |
Cache parameters by 1-based NODE index; only Cache nodes have an entry.
Definition at line 933 of file network_struct.h.
| std::vector<NodeDef> line::qn::NetworkStruct< T >::nodes |
every node, in creation order
Definition at line 850 of file network_struct.h.
| std::vector<Matrix<T> > line::qn::NetworkStruct< T >::nodevisits |
(nchains) each (nnodes x nclasses)
Definition at line 1130 of file network_struct.h.
| std::size_t line::qn::NetworkStruct< T >::nstations = 0 |
Definition at line 1074 of file network_struct.h.
| std::vector<std::vector<std::size_t> > line::qn::NetworkStruct< T >::nvars |
sn.nvars, (nnodes x 3R+1): the LOCAL VARIABLE columns each node appends to its state, beyond the buffer and the servers.
Layout, verbatim from refreshLocalVars:
1 .. R modulating phase, one per class with a MAP/MMPP2 process R+1 .. 2R routing variable, one per class routed round-robin 2R+1 the SHARED node block: cache width, or the BAS blocked marker, or the breakdown status, or the polling controller. They share one column and are therefore mutually exclusive – refreshLocalVars rejects the combinations rather than widening the state. 2R+1+r the REPLY blocked-server counter for calling class r
The trailing sum(nvars(ind,:)) columns are what every state slicer must take clear of before reading the server block.
Definition at line 1171 of file network_struct.h.
| std::map<std::pair<std::size_t, std::size_t>, Matrix<T> > line::qn::NetworkStruct< T >::P |
P[(r,s)] is an (nnodes x nnodes) block; absent means all zero.
Definition at line 881 of file network_struct.h.
| std::map<std::size_t, PasParam> line::qn::NetworkStruct< T >::pasparam |
Definition at line 1230 of file network_struct.h.
| std::map<std::pair<std::size_t, std::size_t>, Matrix<T> > line::qn::NetworkStruct< T >::Peff |
The routing after refresh_routing() has expanded the non-PROB strategies and folded the class switches in.
EMPTY when the expansion is the identity, which is the case for every model whose routing is given as probabilities and has no ClassSwitch node – and then route_eff() reads P directly, so the two representations never drift apart.
Definition at line 889 of file network_struct.h.
| std::map<std::size_t, PollingParam> line::qn::NetworkStruct< T >::pollingparam |
Definition at line 1259 of file network_struct.h.
| Matrix<T> line::qn::NetworkStruct< T >::rates |
(nstations x nclasses) service rates and SCVs, with a PARALLEL disabled flag instead of MATLAB's NaN sentinel.
MATLAB writes NaN into sn.rates for a (station, class) pair the class never visits, and every consumer tests isnan. Rational has no NaN – it is a field, not a floating-point format – so the marker has to be carried out of band or the exact instantiation could not represent a disabled pair at all. The flag is the marker; rates and scv hold zero there, and no consumer may read them without consulting disabled.
Definition at line 1105 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::refclass |
(nchains) 1-based class, 0 = none
Definition at line 1128 of file network_struct.h.
| std::vector<Region> line::qn::NetworkStruct< T >::regions |
Definition at line 1033 of file network_struct.h.
| std::vector<std::vector<bool> > line::qn::NetworkStruct< T >::replyblock |
sn.replyblock (nnodes x nclasses) and sn.syncreply (nclasses).
A SYNCHRONOUS call: a job of a calling class leaves this station for the callee but KEEPS its server, released only when the matching REPLY class arrives back. replyblock marks the (node, calling class) pairs that hold such a server, and syncreply[r] is the 1-based reply class the calling class r expects (0 = none). A CTMC has no job identity to key on as LDES does, so the state carries COUNTS of held servers.
Definition at line 1242 of file network_struct.h.
| std::map<std::size_t, RetrialParam<T> > line::qn::NetworkStruct< T >::retrialparam |
Retrial parameters, keyed by 1-based STATION index.
Definition at line 1037 of file network_struct.h.
| std::vector<Reward> line::qn::NetworkStruct< T >::reward |
Definition at line 1003 of file network_struct.h.
| Matrix<T> line::qn::NetworkStruct< T >::rt |
sn.rt and sn.rtnodes: the class-expanded routing.
rt is (nstateful*nclasses) square over the STATEFUL nodes – the stochastic complement that removes Fork, ClassSwitch and Router nodes – and rtnodes is (nnodes*nclasses) square over every node. Row (i-1)*K + r is node i in class r, which is MATLAB's ordering.
Definition at line 1152 of file network_struct.h.
| Matrix<T> line::qn::NetworkStruct< T >::rtnodes |
Definition at line 1152 of file network_struct.h.
| Matrix<T> line::qn::NetworkStruct< T >::scv |
Definition at line 1105 of file network_struct.h.
| pfqn::SdrStruct line::qn::NetworkStruct< T >::sdr |
Krzesinski (1987) product-form state-dependent routing, in 0-based STATION indices; empty unless a node declares it with set_state_dep_routing.
Branch index 1 denotes the complement M-V and is unused. sdr_nodes is the same structure in 0-based NODE indices.
The routing is state dependent yet keeps a product form of its own, so sn_has_sd_routing is true for it while the normalizing-constant solver still accepts it. See _kb/16-state-dependent-routing.md
Definition at line 900 of file network_struct.h.
| pfqn::SdrStruct line::qn::NetworkStruct< T >::sdr_nodes |
Node-indexed twin of sdr.
Definition at line 902 of file network_struct.h.
| std::vector<std::vector<Distrib<T> > > line::qn::NetworkStruct< T >::service |
service[i][r], 0-based station and class; a disabled entry marks a pair never visited.
Definition at line 856 of file network_struct.h.
| std::map<std::size_t, SetupDelayOffParam<T> > line::qn::NetworkStruct< T >::setupparam |
Setup / delay-off, keyed by 1-based STATION index.
Presence IS MATLAB's sn.hassetup(ist): the reference sets that flag from ~isempty(station.setupTime), so a station appears here exactly when it is a setup task's server.
Definition at line 1045 of file network_struct.h.
| std::vector<std::vector<T> > line::qn::NetworkStruct< T >::signalremdist |
Definition at line 1295 of file network_struct.h.
| std::vector<lang::RemovalPolicy> line::qn::NetworkStruct< T >::signalrempolicy |
Definition at line 1294 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::signaltarget |
Definition at line 1293 of file network_struct.h.
| std::vector<lang::SignalType> line::qn::NetworkStruct< T >::signaltype |
Definition at line 1292 of file network_struct.h.
| std::size_t line::qn::NetworkStruct< T >::sinkNode = 0 |
1-based NODE index of the Sink, 0 = none (it is not a station)
Definition at line 930 of file network_struct.h.
| std::size_t line::qn::NetworkStruct< T >::sourceIdx = 0 |
1-based station index of the Source, 0 = none
Definition at line 929 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::stateful_nodes |
1-based node indices, ascending
Definition at line 853 of file network_struct.h.
| std::map<std::size_t, std::vector<T> > line::qn::NetworkStruct< T >::stateprior |
Definition at line 947 of file network_struct.h.
| std::map<std::size_t, Matrix<T> > line::qn::NetworkStruct< T >::statespace |
Definition at line 948 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::station_to_node |
(nstations) 1-based node index
Definition at line 852 of file network_struct.h.
| std::vector<Station<T> > line::qn::NetworkStruct< T >::stations |
stations[k-1] is the k-th station
Definition at line 851 of file network_struct.h.
| std::vector<std::size_t> line::qn::NetworkStruct< T >::syncreply |
Definition at line 1243 of file network_struct.h.
| std::map<std::size_t, TransitionParam<T> > line::qn::NetworkStruct< T >::transparam |
Transition (SPN) parameters, keyed by 1-based node index.
Definition at line 1035 of file network_struct.h.
| std::vector<Matrix<T> > line::qn::NetworkStruct< T >::visits |
(nchains) each (nstateful x nclasses)
Definition at line 1129 of file network_struct.h.