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.chains=[]; % binary CxK matrix where 1 in entry (i,j) indicates that
class j
is in chain i.
11 sn.classcap=[]; % buffer size
for each class
12 sn.classnames=string([]); % name of each job
class
13 sn.classprio=[]; % scheduling priorities in each
class (optional)
14 sn.classdeadline=[]; % deadline
for each class (Inf = no deadline)
15 sn.connmatrix=[]; % (i,j) entry
if node i can route to node j
16 sn.csmask=[]; % (r,s) entry
if class r can
switch into
class s somewhere
17 %forks; % forks table from each station
18 % (MKxMK matrix with integer entries), indexed first by
19 % station, then by
class
20 sn.droprule=[]; % (i,r) gives the drop rule
for class r at station i
21 sn.fj=[]; % (i,j)
is true if node j can join jobs forked by node i
23 sn.inchain={}; % entry c
is a vector with
class ids in chain c
24 sn.isstatedep=[]; % state dependent routing
25 sn.isstation=[]; % element i
is true if node i
is a station
26 sn.isstateful=[]; % element i
is true if node i
is stateful
27 sn.isslc=[]; % element r
is true if class r self-loops at its reference station
28 sn.immfeed=[]; % (M x K)
boolean matrix: immfeed(i,r) = true if class r uses immediate feedback at station i
29 sn.issignal=[]; % element r
is true if class r
is a signal class (nclasses x 1)
30 sn.signaltype={}; % signal type
for each class, cell(nclasses,1) with NaN for non-signal
classes
31 sn.syncreply=[]; % (nclasses x 1) vector where entry r
is reply signal class index for class r, -1 if no reply expected
32 sn.signalRemovalDist={}; % cell(nclasses,1) with removal distribution for each signal class (empty for single removal)
33 sn.signalRemovalPolicy=[]; % (nclasses x 1) with RemovalPolicy for each signal class
34 sn.isCatastrophe=[]; % (nclasses x 1) where true indicates catastrophe signal
35 sn.lldscaling={}; % limited load-dependent scalings
36 sn.ljdscaling={}; % limited joint-dependent scalings (linearized per station)
37 sn.ljdcutoffs=[]; % per-
class cutoffs for joint dependence (M x K matrix)
38 sn.lst={}; % laplace-stieltjes transform
39 sn.mu={}; % service rate in each service phase,
for each job
class in each station
40 % (MxK cell with n_{i,k}x1
double entries)
41 sn.nchains=[]; % number of chains (
int)
42 sn.nclasses=[]; % number of
classes (
int)
43 sn.nclosedjobs=[]; % total population (
int)
44 sn.njobs=[]; % initial distribution of jobs in
classes (Kx1
int)
45 sn.nnodes=[]; % number of
nodes (Mn
int)
46 sn.nservers=[]; % number of servers per station (Mx1
int)
47 sn.nstations=[]; % number of stations (
int)
48 sn.nstateful=[]; % number of stations (
int)
49 sn.nvars=[]; % number of local variables
50 sn.nodenames=string([]); % name of each node
51 sn.nodeparam={}; % parameters
for local variables
52 sn.nodetype=[]; % server type in each node
54 sn.phases=[]; % number of phases in each service or arrival process
55 sn.phasessz=[]; % number of phases
56 sn.phaseshift=[]; % shift
for phases
57 sn.phi={}; % probability of service completion in each service phase,
58 %
for each job
class in each station
59 % (MxK cell with n_{i,k}x1
double entries)
60 sn.pie={}; % probability of entry in each each service phase
61 sn.proc={}; % cell matrix of service and arrival process representations
62 sn.procid=[]; % service or arrival process type
id
63 sn.rates=[]; % service rate
for each job
class in each station
64 sn.refstat=[]; % index of the reference node
for each request
class (Kx1 int)
65 sn.routing=[]; % routing strategy type
66 sn.rt=[]; % routing table with
class switching
67 % (M*K)x(M*K) matrix with
double entries), indexed first by
68 % station, then by
class
69 sn.rtorig={}; % linked routing table rtorig{r,s}(i,j)
70 sn.rtnodes=[]; % routing table with
class switching
71 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
73 sn.rtfun = @nan; % local routing functions
74 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
75 % station, then by
class
76 sn.sched=[]; % scheduling strategy in each station
77 sn.schedparam=[]; % scheduling weights in each station and
class (optional)
79 sn.space={}; % state space
80 sn.state={}; % initial or current state
81 sn.stateprior={}; % prior distribution of initial or current state
82 sn.scv=[]; % squared coefficient of variation of service times (MxK)
85 % finite capacity regions
86 sn.nregions=[]; % number of finite capacity regions (F)
87 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
88 sn.regionrule=[]; % Matrix(F, K) where entry (f,r)
is DropStrategy for class r in region f
89 sn.regionweight=[]; % Matrix(F, K) where entry (f,r)
is class weight for class r in region f (default 1.0)
90 sn.regionsz=[]; % Matrix(F, K) where entry (f,r)
is class size/memory for class r in region f (default 1)
96 sn.stationToStateful=[];
97 sn.statefulToStation=[];
100 % reward definitions for CTMC reward computation
101 sn.reward={}; % cell array of reward definitions
102 % each entry
is a
struct with fields:
103 % .name - string identifier for the reward
104 % .fn - function handle @(state, sn) -> double
105 % .type - reward type ('state' for state-dependent)
107 % heterogeneous server fields
108 sn.nservertypes=[]; % (M x 1) number of server types per station (0 = homogeneous)
109 sn.servertypenames={}; % {station}{type} = name of server type
110 sn.serverspertype={}; % {station}(type) = count of servers of that type
111 sn.servercompat={}; % {station}(type,
class) = 1
if type serves
class, 0 otherwise
112 sn.heterorates={}; % {station}{type,
class} = service rate
113 sn.heteroproc={}; % {station}{type,
class} = {D0, D1} PH matrices
114 sn.heteroprocid=[]; % (M x nTypes x K) or {station}(type,
class) = ProcessType
id
115 sn.heteroschedpolicy=[]; % (M x 1) HeteroSchedPolicy per station