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.issignal=[]; % element r
is true if class r
is a signal class (nclasses x 1)
29 sn.signaltype={}; % signal type
for each class, cell(nclasses,1) with NaN for non-signal
classes
30 sn.syncreply=[]; % (nclasses x 1) vector where entry r
is reply signal class index for class r, -1 if no reply expected
31 sn.lldscaling={}; % limited load-dependent scalings
32 sn.lst={}; % laplace-stieltjes transform
33 sn.mu={}; % service rate in each service phase,
for each job
class in each station
34 % (MxK cell with n_{i,k}x1
double entries)
35 sn.nchains=[]; % number of chains (
int)
36 sn.nclasses=[]; % number of
classes (
int)
37 sn.nclosedjobs=[]; % total population (
int)
38 sn.njobs=[]; % initial distribution of jobs in
classes (Kx1
int)
39 sn.nnodes=[]; % number of
nodes (Mn
int)
40 sn.nservers=[]; % number of servers per station (Mx1
int)
41 sn.nstations=[]; % number of stations (
int)
42 sn.nstateful=[]; % number of stations (
int)
43 sn.nvars=[]; % number of local variables
44 sn.nodenames=string([]); % name of each node
45 sn.nodeparam={}; % parameters
for local variables
46 sn.nodetype=[]; % server type in each node
48 sn.phases=[]; % number of phases in each service or arrival process
49 sn.phasessz=[]; % number of phases
50 sn.phaseshift=[]; % shift
for phases
51 sn.phi={}; % probability of service completion in each service phase,
52 %
for each job
class in each station
53 % (MxK cell with n_{i,k}x1
double entries)
54 sn.pie={}; % probability of entry in each each service phase
55 sn.proc={}; % cell matrix of service and arrival process representations
56 sn.procid=[]; % service or arrival process type
id
57 sn.rates=[]; % service rate
for each job
class in each station
58 sn.refstat=[]; % index of the reference node
for each request
class (Kx1 int)
59 sn.routing=[]; % routing strategy type
60 sn.rt=[]; % routing table with
class switching
61 % (M*K)x(M*K) matrix with
double entries), indexed first by
62 % station, then by
class
63 sn.rtorig={}; % linked routing table rtorig{r,s}(i,j)
64 sn.rtnodes=[]; % routing table with
class switching
65 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
67 sn.rtfun = @nan; % local routing functions
68 % (Mn*K)x(Mn*K) matrix with
double entries), indexed first by
69 % station, then by
class
70 sn.sched=[]; % scheduling strategy in each station
71 sn.schedparam=[]; % scheduling weights in each station and
class (optional)
73 sn.space={}; % state space
74 sn.state={}; % initial or current state
75 sn.stateprior={}; % prior distribution of initial or current state
76 sn.scv=[]; % squared coefficient of variation of service times (MxK)
79 % finite capacity regions
80 sn.nregions=[]; % number of finite capacity regions (F)
81 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
82 sn.regionrule=[]; % vector of length F where entry (f)
is DropStrategy for region f
88 sn.stationToStateful=[];
89 sn.statefulToStation=[];
92 % reward definitions for CTMC reward computation
93 sn.reward={}; % cell array of reward definitions
94 % each entry
is a
struct with fields:
95 % .name - string identifier for the reward
96 % .fn - function handle @(state, sn) -> double
97 % .type - reward type ('state' for state-dependent)