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 scalings
10 sn.cdscalingpeak=[]; % (nstations x nclasses) declared peak
class-dependent rate scaling,
for Util=T*S/peak normalization
11 sn.chains=[]; % binary CxK matrix where 1 in entry (i,j) indicates that
class j
is in chain i.
12 sn.classcap=[]; % buffer size
for each class
13 sn.classnames=string([]); % name of each job
class
14 sn.classprio=[]; % scheduling priorities in each
class (optional)
15 sn.classdeadline=[]; % deadline
for each class (Inf = no deadline)
16 sn.connmatrix=[]; % (i,j) entry
if node i can route to node j
17 sn.csmask=[]; % (r,s) entry
if class r can
switch into
class s somewhere
18 %forks; % forks table from each station
19 % (MKxMK matrix with integer entries), indexed first by
20 % station, then by
class
21 sn.droprule=[]; % (i,r) gives
the drop rule
for class r at station i
22 sn.fj=[]; % (i,j)
is true if node j can join jobs forked by node i
23 sn.fjsync={}; % fork firing synchronizations (set only on FJ-augmented structs, see ModelAdapter.fjtag)
24 sn.fjclassmap=[]; % (1,nclasses) original
class of each FJ auxiliary
class, 0
for originals (FJ-augmented structs only)
25 sn.isfjaugmented=
false; %
true on FJ tag-augmented structs (Join/Fork carry
count-vector states)
27 sn.inchain={}; % entry c
is a vector with
class ids in chain c
28 sn.isstatedep=[]; % state dependent routing
29 sn.isstation=[]; % element i
is true if node i
is a station
30 sn.isstateful=[]; % element i
is true if node i
is stateful
31 sn.isslc=[]; % element r
is true if class r self-loops at its reference station
32 sn.immfeed=[]; % (M x K)
boolean matrix: immfeed(i,r) = true if class r uses immediate feedback at station i
33 sn.issignal=[]; % element r
is true if class r
is a signal class (nclasses x 1)
34 sn.signaltype={}; % signal type
for each class, cell(nclasses,1) with NaN for non-signal classes
35 sn.syncreply=[]; % (nclasses x 1) vector where entry r
is reply signal class index for class r, -1 if no reply expected
36 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
37 sn.signalremdist={}; % cell(nclasses,1) with removal distribution for each signal class (empty for single removal)
38 sn.signalrempolicy=[]; % (nclasses x 1) with RemovalPolicy for each signal class
39 sn.iscatastrophe=[]; % (nclasses x 1) where true indicates catastrophe signal
40 sn.lldscaling={}; % limited load-dependent scalings
41 sn.lst={}; % laplace-stieltjes transform
42 sn.mu={}; % service rate in each service phase,
for each job
class in each station
43 % (MxK cell with n_{i,k}x1
double entries)
44 sn.nchains=[]; % number of chains (
int)
45 sn.nclasses=[]; % number of classes (
int)
46 sn.nclosedjobs=[]; % total population (
int)
47 sn.njobs=[]; % initial distribution of jobs in classes (Kx1
int)
48 sn.nnodes=[]; % number of
nodes (Mn
int)
49 sn.nservers=[]; % number of servers per station (Mx1
int)
50 sn.nstations=[]; % number of stations (
int)
51 sn.nstateful=[]; % number of stations (
int)
52 sn.nvars=[]; % number of local variables
53 sn.isbasblocking=[]; % (nnodes,1) 1 iff
the node
is the upstream/blocking side of a
true-BAS relation (BUG-83)
54 sn.nodenames=string([]); % name of each node
55 sn.nodeparam={}; % parameters
for local variables
56 sn.nodetype=[]; % server type in each node
58 sn.phases=[]; % number of phases in each service or arrival process
59 sn.phasessz=[]; % number of phases
60 sn.phaseshift=[]; % shift
for phases
61 sn.phi={}; % probability of service completion in each service phase,
62 %
for each job
class in each station
63 % (MxK cell with n_{i,k}x1
double entries)
64 sn.pie={}; % probability of entry in each each service phase
65 sn.proc={}; % cell matrix of service and arrival process representations
66 sn.procid=[]; % service or arrival process type
id
67 sn.rates=[]; % service rate
for each job
class in each station
68 sn.refstat=[]; % index of
the reference node
for each request
class (Kx1 int)
69 sn.routing=[]; % routing strategy type
70 sn.rt=[]; % routing table with
class switching
71 % (M*K)x(M*K) matrix with
double entries), indexed first by
72 % station, then by
class
73 sn.rtorig={}; % linked routing table rtorig{r,s}(i,j)
74 sn.rtnodes=[]; % routing table with
class switching
75 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
77 sn.rtfun = @nan; % local routing functions
78 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
79 % station, then by
class
80 sn.sched=[]; % scheduling strategy in each station
81 sn.schedparam=[]; % scheduling weights in each station and
class (optional)
83 sn.space={}; % state space
84 sn.state={}; % initial or current state
85 sn.stateprior={}; % prior distribution of initial or current state
86 sn.scv=[]; % squared coefficient of variation of service times (MxK)
87 sn.visits={}; %
visits placed by classes at
the resources
89 % finite capacity regions
90 sn.nregions=[]; % number of finite capacity regions (F)
91 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
92 sn.regionrule=[]; % Matrix(F, K) where entry (f,r)
is DropStrategy for class r in region f
93 sn.regionweight=[]; % Matrix(F, K) where entry (f,r)
is class weight for class r in region f (default 1.0)
94 sn.regionsz=[]; % Matrix(F, K) where entry (f,r)
is class size/memory for class r in region f (default 1)
95sn.regionmaxmem={}; % cell(F,1); regionmaxmem{f}
is Matrix(M,1) with
the region global memory budget replicated on member station rows, -1 = unbounded
96 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
97 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
100 sn.nodeToStateful=[];
103 sn.stationToStateful=[];
104 sn.statefulToStation=[];
105 sn.statefulToNode=[];
107 % reward definitions
for CTMC reward computation
108 sn.reward={}; % cell array of reward definitions
109 % each entry
is a
struct with fields:
110 % .name - string identifier for
the reward
111 % .fn - function handle @(state, sn) -> double
112 % .type - reward type ('state' for state-dependent)
114 % cache item state tracking (mirrors JAR varsparam)
115 sn.varsparam=[]; % (nnodes x 1) item indices for cache state, -1 = none
117 % marked (MMAP) source arrivals (populated by refreshStruct)
118 sn.markidx=[]; % (nstations x nclasses) mark index (1-based) of class r
119 % at source station i, -1 = not a marked class
121 % balking and retrial fields (populated by refreshStruct)
122 sn.balkingStrategy=[]; % (M x K) BalkingStrategy id per (station,class), 0 = none
123 sn.balkingThresholds={}; % (M x K) cell of {minJobs,maxJobs,prob} tuples per (station,
class)
124 sn.retrialType=[]; % (M x K) ProcessType
id of retrial delay distribution, 0 = none
125 sn.retrialMu=[]; % (M x K) retrial delay rate (1/mean)
126 sn.retrialPhi=[]; % (M x K) retrial delay SCV
127 sn.retrialProc={}; % (M x K) cell of {D0,D1} MAP/PH representation
128 sn.retrialMaxAttempts=[]; % (M x K) max retrial attempts (-1 = unlimited)
129 sn.orbitImpatience={}; % (M x K) cell of {D0,D1} orbit abandonment representation
131 % heterogeneous server fields are ragged, node-type-conditional parameters and
132 % therefore live in
the nodeparam container (indexed by node), not as flat root
133 % fields. For a Queue node ind with server types, sn.nodeparam{ind} carries
the
134 % fields: nservertypes, servertypenames, serverspertype, servercompat,
135 % heteroschedpolicy (see @MNetwork/refreshStruct.m).