LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
network_struct.h File Reference

A queueing network and its refreshed NetworkStruct. More...

#include "line/util/line_console.h"
#include <algorithm>
#include <cmath>
#include <functional>
#include <limits>
#include <map>
#include <string>
#include <vector>
#include "line/api/mc/dtmc_solve.h"
#include "line/api/mc/dtmc_solve_reducible.h"
#include "line/api/mc/dtmc_stochcomp.h"
#include "line/api/mc/stronglyconncomp.h"
#include "line/api/pfqn/pfqn_sdr.h"
#include "line/lang/lang_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for network_struct.h:

Go to the source code of this file.

Classes

struct  line::qn::FjSync< T >
 One fork firing synchronization: sn.fjsync{k}. More...
struct  line::qn::FjJoinParam
 sn.nodeparam{j}.fj: what a Join node needs to fire on identity. More...
struct  line::qn::ForkParam< T >
 Variable forking levels, the twin of MATLAB sn.nodeparam{f}.fanOutLink / .fanOutProb / .fanOutDist. More...
struct  line::qn::NodeDef
 A node of the network. More...
struct  line::qn::NodeDef::LoggerParam
 A Logger node's trace configuration, MATLAB's Logger properties and sn.nodeparam{ind} for a Logger. More...
struct  line::qn::TransitionParam< T >
 The parameters of a Cache node, MATLAB's sn.nodeparam{ind} for a Cache. More...
struct  line::qn::RetrialParam< T >
 The parameters of a retrial station: MATLAB sn.retrialProc and friends. More...
struct  line::qn::SetupDelayOffParam< T >
 Setup and delay-off of a station that powers down when it falls idle. More...
struct  line::qn::BreakdownParam< T >
 Server breakdown and repair of a station whose server fails and is repaired. More...
struct  line::qn::CacheParam< T >
struct  line::qn::CacheParam< T >::Popularity
 The popularity LAW each class declared, beside the pmf it expands to. More...
struct  line::qn::Station< T >
 One station of the network. More...
struct  line::qn::Station< T >::BalkingThreshold
 One balking threshold: with min_jobs <= n <= max_jobs at the station, an arriving job of the class refuses to join with probability. More...
struct  line::qn::Station< T >::BalkingParam
 Per class; strategy == NONE is a class that declares no balking. More...
struct  line::qn::Station< T >::ServerType
 A heterogeneous server pool: count servers that serve only compatible classes, each with its own service law. More...
struct  line::qn::JobClass
 One job class of the network. More...
class  line::qn::NetworkStruct< T >
 A network plus its refreshed NetworkStruct. More...
struct  line::qn::NetworkStruct< T >::JoinDecl
 The DECLARED join rule of a Join node, by 1-based node index. More...
struct  line::qn::NetworkStruct< T >::Reward
 sn.reward: the user-declared reward functions, MATLAB's model.setReward(name, fn). More...
struct  line::qn::NetworkStruct< T >::Region
 FINITE CAPACITY REGIONS, MATLAB's refreshRegions output. More...
struct  line::qn::NetworkStruct< T >::PasParam
 The G-network signal declaration, per CLASS. More...
struct  line::qn::NetworkStruct< T >::PollingParam
 The polling controller of a POLLING station, keyed by station index. More...
struct  line::qn::Distrib< T >
struct  line::qn::GlobalConstants
 The MATLAB GlobalConstants, as reported by lineStart at its defaults. More...

Namespaces

namespace  line
namespace  line::qn

Typedefs

template<class T>
using line::qn::CdScaling
 A class-dependent scaling map, sn.cdscaling.
template<class T>
using line::qn::GdScaling
 A globally state-dependent scaling, sn.gdscaling.

Enumerations

enum class  line::qn::DropStrategy
 Blocking and loss rules, with the values of MATLAB DropStrategy. More...
enum class  line::qn::JobClassType
 Job class kinds, with the values of MATLAB JobClassType. More...
enum class  line::qn::ReplacementStrategy
 Cache replacement policies, with the values of MATLAB ReplacementStrategy. More...
enum class  line::qn::NodeType
 Node kinds, with the values of MATLAB NodeType. More...
enum class  line::qn::ProcessType
 Distribution kinds, with the values of MATLAB ProcessType. More...
enum class  line::qn::RoutingStrategy
 Routing strategies, with the values of MATLAB RoutingStrategy. More...
enum class  line::qn::SchedStrategy
 Scheduling disciplines, with the values of MATLAB SchedStrategy. More...

Functions

template<class T>
void line::qn::cache_retrieval_class_map (const CacheParam< T > &cp, std::vector< std::size_t > &rc_list, std::vector< std::size_t > &rc_items, std::vector< std::size_t > &rc_orig)
 Port of State.cacheRetrievalClassMap: the canonical order of a cache's retrieval classes, which is the column order of block B.
template<class T>
Matrix< T > line::qn::station_swap_graph (const NetworkStruct< T > &sn, std::size_t ist)
 The swap graph of a PAS / OI station, with the defaults refreshLocalVars.m installs applied.
template<class T>
bool line::qn::station_swap_graph_is_zero (const NetworkStruct< T > &sn, std::size_t ist)
 True when the station's materialized swap graph is entirely zero.
const char * line::qn::routing_to_text (RoutingStrategy r)

Detailed Description

A queueing network and its refreshed NetworkStruct.

SCOPE. This is the sn of matlab/src/lang/@@MNetwork/refreshStruct.m, held together with the model it was refreshed from, because every consumer of a struct in this port also mutates the model and re-derives it (SolverLN re-parameterises service processes between outer iterations, the fork-join transform rewrites routing). MATLAB does the same through the sn its Network caches.

It grew out of the SolverLN layer – which is now qn::Layer<T>, a NetworkStruct plus the LQN element annotations – so the fields a layer never carries are being filled in as the solvers that read them are ported. What is ABSENT is absent by name, never silently: a model needing an unported field is refused where the field would be read.

NODES vs STATIONS vs STATEFUL NODES. There are three nested index spaces, exactly as sn has, and they stopped coinciding the moment fork/join arrived:

nodes everything routing passes through: the stations, plus a Fork, its output Routers, a Join, a Sink stateful the nodes that hold jobs: every node except the Fork stations the nodes that serve jobs, including a Join (which serves at rate Inf) and a Source (whose service process is the arrival process)

Routing (P, and the rtnodes derived from it) lives at NODE level; rt is its stochastic complement over the stateful nodes, which is what eliminates the Fork; visits is indexed by stateful node and nodevisits by node.

ClassSwitch NODES ARE MATERIALISED, as @MNetwork/link.m:225-329 does it: link() inserts one CS_<i>_to_<j> per ordered pair of linked nodes whose routing switches class, folds the switching probability into the first leg and leaves every surviving route SAME-CLASS. The stochastic complement in rt removes them again, since they are not stateful, so rt is unchanged by their presence; rtnodes and nnodes carry the extra hop, which is what the node table reports and what the JSIM export needs (jmt_writer.h can only emit a ClassSwitch for a node whose type IS ClassSwitch). Until 2026-08-04 this port kept the switch on the EDGE and synthesized nothing; the analytical solvers read that correctly through route_eff, but the node count was one short per switch and JMT silently simulated the UNSWITCHED model. Verified rather than assumed: the regression compares chains, inchain, refstat, refclass, njobs, nservers, rates, scv and visits against MATLAB dumps.

ARITHMETIC. Rates, service times, routing probabilities and visits are T. Populations and server counts are double, since they are counts that may be infinite (a delay station, an open class).

Definition in file network_struct.h.