LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ProcessType.m
1classdef (Sealed) ProcessType
2 % Enumeration of process ts
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 EXP = 0;
9 ERLANG = 1;
10 HYPEREXP = 2;
11 PH = 3;
12 APH = 4;
13 MAP = 5;
14 UNIFORM = 6;
15 DET = 7;
16 COXIAN = 8;
17 GAMMA = 9;
18 PARETO = 10;
19 MMPP2 = 11;
20 REPLAYER = 12;
21 TRACE = 12;
22 IMMEDIATE = 13;
23 DISABLED = 14;
24 COX2 = 15;
25 WEIBULL = 16;
26 LOGNORMAL = 17;
27 DUNIFORM = 18;
28 BERNOULLI = 19;
29 PRIOR = 20;
30 BINOMIAL = 21;
31 POISSON = 22;
32 GEOMETRIC = 23;
33 BMAP = 24;
34 ME = 25;
35 RAP = 26;
36 DISCRETESAMPLER = 27;
37 ZIPF = 28;
38 DMAP = 29;
39 MMAP = 31;
40 EMPIRICALCDF = 32;
41 NHPP = 33;
42 end
43
44 methods (Static)
45 function t = fromId(id)
46 % ID = TOID(TYPE)
47 t = id;
48 end
49
50 function id = toId(t)
51 % ID = TOID(TYPE)
52 id = t;
53 end
54
55 function t = fromText(text)
56 % TIMMEDIATE = TOID(TYPE)
57 switch text
58 case 'Exp'
59 t = ProcessType.EXP;
60 case 'Erlang'
61 t = ProcessType.ERLANG;
62 case 'HyperExp'
63 t = ProcessType.HYPEREXP;
64 case 'PH'
65 t = ProcessType.PH;
66 case 'APH'
67 t = ProcessType.APH;
68 case 'MAP'
69 t = ProcessType.MAP;
70 case 'Uniform'
71 t = ProcessType.UNIFORM;
72 case 'Det'
73 t = ProcessType.DET;
74 case 'Coxian'
75 t = ProcessType.COXIAN;
76 case 'Gamma'
77 t = ProcessType.GAMMA;
78 case 'Pareto'
79 t = ProcessType.PARETO;
80 case 'MMPP2'
81 t = ProcessType.MMPP2;
82 case {'Replayer', 'Trace'}
83 t = ProcessType.REPLAYER;
84 case 'Immediate'
85 t = ProcessType.IMMEDIATE;
86 case 'Disabled'
87 t = ProcessType.DISABLED;
88 case 'Cox2'
89 t = ProcessType.COX2;
90 case 'Weibull'
91 t = ProcessType.WEIBULL;
92 case 'Lognormal'
93 t = ProcessType.LOGNORMAL;
94 case 'DiscreteUniform'
95 t = ProcessType.DUNIFORM;
96 case 'Bernoulli'
97 t = ProcessType.BERNOULLI;
98 case 'Prior'
99 t = ProcessType.PRIOR;
100 case 'Binomial'
101 t = ProcessType.BINOMIAL;
102 case 'Poisson'
103 t = ProcessType.POISSON;
104 case 'Geometric'
105 t = ProcessType.GEOMETRIC;
106 case 'BMAP'
107 t = ProcessType.BMAP;
108 case {'ME', 'CME'}
109 % A CME is an ME: the concentrated representation is a
110 % subclass of ME and carries no distinct process type, so
111 % every solver gate and sn.procid entry that accepts ME
112 % accepts it. refreshProcessTypes passes the class name, so
113 % the subclass has to be listed here explicitly.
114 t = ProcessType.ME;
115 case 'RAP'
116 t = ProcessType.RAP;
117 case 'DiscreteSampler'
118 t = ProcessType.DISCRETESAMPLER;
119 case 'Zipf'
120 t = ProcessType.ZIPF;
121 case 'DMAP'
122 t = ProcessType.DMAP;
123 case 'NHPP'
124 t = ProcessType.NHPP;
125 case 'EmpiricalCDF'
126 % Class name, as passed by refreshProcessTypes. Without this
127 % case an EmpiricalCDF service aborts fromText during
128 % getStruct, before any solver feature gate can report that
129 % the distribution is unsupported.
130 t = ProcessType.EMPIRICALCDF;
131 case {'MarkedMAP', 'MMAP', 'MarkedMMPP'}
132 t = ProcessType.MMAP;
133 otherwise
134 line_error(mfilename, sprintf('Unrecognized process type: %s', text));
135 end
136 end
137
138 function text = toText(t)
139 % TEXT = TOTEXT(TYPE)
140 switch t
141 case ProcessType.EXP
142 text = 'Exp';
143 case ProcessType.ERLANG
144 text = 'Erlang';
145 case ProcessType.HYPEREXP
146 text = 'HyperExp';
147 case ProcessType.PH
148 text = 'PH';
149 case ProcessType.APH
150 text = 'APH';
151 case ProcessType.MAP
152 text = 'MAP';
153 case ProcessType.UNIFORM
154 text = 'Uniform';
155 case ProcessType.DET
156 text = 'Det';
157 case ProcessType.COXIAN
158 text = 'Coxian';
159 case ProcessType.GAMMA
160 text = 'Gamma';
161 case ProcessType.PARETO
162 text = 'Pareto';
163 case ProcessType.MMPP2
164 text = 'MMPP2';
165 case {ProcessType.REPLAYER, ProcessType.TRACE}
166 text = 'Replayer';
167 case ProcessType.IMMEDIATE
168 text = 'Immediate';
169 case ProcessType.DISABLED
170 text = 'Disabled';
171 case ProcessType.COX2
172 text = 'Cox2';
173 case ProcessType.WEIBULL
174 text = 'Weibull';
175 case ProcessType.LOGNORMAL
176 text = 'Lognormal';
177 case ProcessType.DUNIFORM
178 text = 'DiscreteUniform';
179 case ProcessType.BERNOULLI
180 text = 'Bernoulli';
181 case ProcessType.PRIOR
182 text = 'Prior';
183 case ProcessType.BINOMIAL
184 text = 'Binomial';
185 case ProcessType.POISSON
186 text = 'Poisson';
187 case ProcessType.GEOMETRIC
188 text = 'Geometric';
189 case ProcessType.BMAP
190 text = 'BMAP';
191 case ProcessType.ME
192 text = 'ME';
193 case ProcessType.RAP
194 text = 'RAP';
195 case ProcessType.DISCRETESAMPLER
196 text = 'DiscreteSampler';
197 case ProcessType.ZIPF
198 text = 'Zipf';
199 case ProcessType.DMAP
200 text = 'DMAP';
201 case ProcessType.NHPP
202 text = 'NHPP';
203 case ProcessType.MMAP
204 text = 'MMAP';
205 case ProcessType.EMPIRICALCDF
206 text = 'EmpiricalCDF';
207 otherwise
208 if isnan(t)
209 text = 'Unknown';
210 else
211 text = sprintf('Unknown(%d)', t);
212 end
213 end
214
215 end
216
217 end
218end
Definition Station.m:245