1function sn=NetworkStruct()
2 % Data structure representation
for a Network
object
4 % Copyright (c) 2012-2026, Imperial College London
7 sn=[]; %faster than sn=
struct();
8 sn.cap=[]; % total buffer size
9 sn.cdscaling={}; %
class-dependent (product-
form) scalings
beta_{i,r}(n): per-class output, argument the own-class marginal
n_{i,r} or the total; see setClassDependence
10 sn.cdscalingpeak=[]; % (nstations x nclasses) declared peak
class-dependent rate scaling,
for Util=T*S/peak normalization
11 sn.jdscaling={}; % joint-dependent (non-product-
form) scalings eta_i(n): scalar shared across classes or per-class, argument the joint vector (
n_{i,1},...,
n_{i,R}); see setJointDependence
12 sn.jdscalingpeak=[]; % (nstations x nclasses) declared peak joint-dependent rate scaling,
for Util=T*S/peak normalization
13 sn.chains=[]; % binary CxK matrix where 1 in entry (i,j) indicates that
class j
is in chain i.
14 sn.classcap=[]; % buffer size
for each class
15 sn.classnames=string([]); % name of each job
class
16 sn.classprio=[]; % scheduling priorities in each
class (optional)
17 sn.classdeadline=[]; % deadline
for each class (Inf = no deadline)
18 sn.connmatrix=[]; % (i,j) entry
if node i can route to node j
19 sn.csmask=[]; % (r,s) entry
if class r can
switch into
class s somewhere
20 %forks; % forks table from each station
21 % (MKxMK matrix with integer entries), indexed first by
22 % station, then by
class
23 sn.droprule=[]; % (i,r) gives the drop rule
for class r at station i
24 sn.fj=[]; % (i,j)
is true if node j can join jobs forked by node i
25 sn.fjsync={}; % fork firing synchronizations (set only on FJ-augmented structs, see ModelAdapter.fjtag)
26 sn.fjclassmap=[]; % (1,nclasses) original
class of each FJ auxiliary
class, 0
for originals (FJ-augmented structs only)
27 sn.isfjaugmented=
false; %
true on FJ tag-augmented structs (Join/Fork carry count-vector states)
29 sn.inchain={}; % entry c
is a vector with
class ids in chain c
30 sn.isstatedep=[]; % state dependent routing
31 sn.isstation=[]; % element i
is true if node i
is a station
32 sn.isstateful=[]; % element i
is true if node i
is stateful
33 sn.isslc=[]; % element r
is true if class r self-loops at its reference station
34 sn.immfeed=[]; % (M x K)
boolean matrix: immfeed(i,r) = true if class r uses immediate feedback at station i
35 sn.issignal=[]; % element r
is true if class r
is a signal class (nclasses x 1)
36 sn.signaltype={}; % signal type
for each class, cell(nclasses,1) with NaN for non-signal classes
37 sn.syncreply=[]; % (nclasses x 1) vector where entry r
is reply signal class index for class r, -1 if no reply expected
38 sn.classspawn=[]; % (nclasses x 1) vector where entry r
is the class injected at the same station on each completion of class r, -1 if none
39 sn.signalremdist={}; % cell(nclasses,1) with removal distribution for each signal class (empty for single removal)
40 sn.signalrempolicy=[]; % (nclasses x 1) with RemovalPolicy for each signal class
41 sn.iscatastrophe=[]; % (nclasses x 1) where true indicates catastrophe signal
42 sn.lldscaling={}; % limited load-dependent scalings
43 sn.lst={}; % laplace-stieltjes transform
44 sn.mu={}; % service rate in each service phase,
for each job
class in each station
45 % (MxK cell with
n_{i,k}x1
double entries)
46 sn.nchains=[]; % number of chains (
int)
47 sn.nclasses=[]; % number of classes (
int)
48 sn.nclosedjobs=[]; % total population (
int)
49 sn.njobs=[]; % initial distribution of jobs in classes (Kx1
int)
50 sn.nnodes=[]; % number of
nodes (Mn
int)
51 sn.nservers=[]; % number of servers per station (Mx1
int)
52 sn.nstations=[]; % number of stations (
int)
53 sn.nstateful=[]; % number of stations (
int)
54 sn.nvars=[]; % number of local variables
55 sn.isbasblocking=[]; % (nnodes,1) 1 iff the node
is the upstream/blocking side of a
true-BAS relation (BUG-83)
56 sn.isbasdestination=[]; % (nstations,nclasses)
true iff refusing an arrival here must block an upstream BAS station
57 sn.nodenames=
string([]); % name of each node
58 sn.nodeparam={}; % parameters
for local variables
59 sn.nodetype=[]; % server type in each node
60 sn.nodevisits={}; %
visits placed by classes at the
nodes
61 sn.phases=[]; % number of phases in each service or arrival process
62 sn.phasessz=[]; % number of phases
63 sn.phaseshift=[]; % shift
for phases
64 sn.phi={}; % probability of service completion in each service phase,
65 %
for each job
class in each station
66 % (MxK cell with
n_{i,k}x1
double entries)
67 sn.pie={}; % probability of entry in each each service phase
68 sn.proc={}; % cell matrix of service and arrival process representations
69 sn.procid=[]; % service or arrival process type
id
70 sn.rates=[]; % service rate
for each job
class in each station
71 sn.refstat=[]; % index of the reference node
for each request
class (Kx1 int)
72 sn.routing=[]; % routing strategy type
73 sn.rt=[]; % routing table with
class switching
74 % (M*K)x(M*K) matrix with
double entries), indexed first by
75 % station, then by
class
76 sn.rtorig={}; % linked routing table rtorig{r,s}(i,j)
77 sn.rtnodes=[]; % routing table with
class switching
78 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
80 sn.rtfun = @nan; % local routing functions
81 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
82 % station, then by
class
83 sn.sched=[]; % scheduling strategy in each station
84 sn.schedparam=[]; % scheduling weights in each station and
class (optional)
86 sn.space={}; % state space
87 sn.state={}; % initial or current state
88 sn.stateprior={}; % prior distribution of initial or current state
89 sn.scv=[]; % squared coefficient of variation of service times (MxK)
90 sn.visits={}; %
visits placed by classes at the resources
92 % finite capacity regions
93 sn.nregions=[]; % number of finite capacity regions (F)
94 sn.region={}; % cell array of size F; region{f}
is Matrix(M, K+1) where entry (i,r)
is max jobs of class r at station i in region f; (i,K+1)
is global max at station i; -1 = infinite
95 sn.regionrule=[]; % Matrix(F, K) where entry (f,r)
is DropStrategy for class r in region f
96 sn.regionweight=[]; % Matrix(F, K) where entry (f,r)
is class weight for class r in region f (default 1.0)
97 sn.regionsz=[]; % Matrix(F, K) where entry (f,r)
is class size/memory for class r in region f (default 1)
98sn.regionmaxmem={}; % cell(F,1); regionmaxmem{f}
is Matrix(M,1) with the region global memory budget replicated on member station rows, -1 = unbounded
99 sn.regionlincon={}; % cell(F,2); regionlincon{f,1}
is Matrix(C_f, K) linear constraint matrix and regionlincon{f,2}
is Matrix(C_f, 1) capacity vector for region f
100 sn.regionmembers={}; % cell(F,1); regionmembers{f}
is logical(M,1),
true where station i belongs to region f. Membership
is NOT recoverable from region{f}: -1 there means unbounded, which
is indistinguishable from not-a-member, so a region constrained only by regionlincon would read as empty
103 sn.nodeToStateful=[];
106 sn.stationToStateful=[];
107 sn.statefulToStation=[];
108 sn.statefulToNode=[];
110 % reward definitions
for CTMC reward computation
111 sn.reward={}; % cell array of reward definitions
112 % each entry
is a
struct with fields:
113 % .name - string identifier for the reward
114 % .fn - function handle @(state, sn) -> double
115 % .type - reward type ('state' for state-dependent)
117 % cache item state tracking (mirrors JAR varsparam)
118 sn.varsparam=[]; % (nnodes x 1) item indices for cache state, -1 = none
120 % marked (MMAP) source arrivals (populated by refreshStruct)
121 sn.markidx=[]; % (nstations x nclasses) mark index (1-based) of class r
122 % at source station i, -1 = not a marked class
124 % balking and retrial fields (populated by refreshStruct)
125 sn.balkingStrategy=[]; % (M x K) BalkingStrategy id per (station,class), 0 = none
126 sn.balkingThresholds={}; % (M x K) cell of {minJobs,maxJobs,prob} tuples per (station,
class)
127 sn.retrialType=[]; % (M x K) ProcessType
id of retrial delay distribution, 0 = none
128 sn.retrialMu=[]; % (M x K) retrial delay rate (1/mean)
129 sn.retrialPhi=[]; % (M x K) retrial delay SCV
130 sn.retrialProc={}; % (M x K) cell of {D0,D1} MAP/PH representation
131 sn.retrialMaxAttempts=[]; % (M x K) max retrial attempts (-1 = unlimited)
132 sn.retrialPolicy=[]; % (M x K) RetrialPolicy: LINEAR = per-customer rate n*nu, CONSTANT = orbit-wide rate nu
133 sn.orbitMaxJobs=[]; % (M x K) orbit capacity (-1 = unbounded); a job finding the orbit full
is lost
134 sn.orbitImpatience={}; % (M x K) cell of {D0,D1} orbit abandonment representation
135 % server breakdown / repair fields (populated by refreshStruct)
136 sn.hasbreakdown=[]; % (nnodes,1) 1 iff the node
's server is subject to breakdowns
137 sn.breakdownMu=[]; % (M x 1) failure rate of an up server (0 = never fails)
138 sn.repairMu=[]; % (M x 1) repair rate of a down server (0 = never repaired)
139 sn.breakdownProc={}; % (M x 1) cell of {D0,D1} failure-time representation
140 sn.repairProc={}; % (M x 1) cell of {D0,D1} repair-time representation
141 sn.downServiceRates=[]; % (M x K) service rate while the server is down (0 = no service)
143 % heterogeneous server fields are ragged, node-type-conditional parameters and
144 % therefore live in the nodeparam container (indexed by node), not as flat root
145 % fields. For a Queue node ind with server types, sn.nodeparam{ind} carries the
146 % fields: nservertypes, servertypenames, serverspertype, servercompat,
147 % heteroschedpolicy (see @MNetwork/refreshStruct.m).