1classdef (Sealed) ProcessType
2 % Enumeration of process ts
4 % Copyright (c) 2012-2026, Imperial College London
45 function
bool = isMarkovian(t)
46 % BOOL = ISMARKOVIAN(T)
48 % True when sn.proc carries an exact matrix representation of a
49 % process of type T: a genuine (D0,D1) pair, or its
50 % matrix-exponential analogue
for ME/RAP.
52 % The distinction
is about SN.PROC, not about what getProcess
53 % returns. getProcess hands back raw distribution PARAMETERS
for
54 % several non-Markovian families -- Gamma, Weibull, Lognormal,
55 % Pareto and Uniform
return two scalars (Pareto {alpha,k}, Uniform
56 % {min,max}) -- and refreshProcessRepresentations replaces those
57 % with convertToMAP = map_erlang(mean, n) before storing them in
58 % sn.proc, where n = ceil(1/SCV) capped at 100 (n = 20 when
59 % SCV < CoarseTol). That fit matches the mean, and matches the SCV
60 % only when SCV <= 1: Pareto with SCV 64 gives n = 1, a single
61 % exponential of SCV 1. So for these types sn.proc
is an
62 % approximation, not the law that was requested, and nothing on the
63 % cell says so -- the only signal
is sn.procid.
65 % Solvers that read sn.proc as if it were the exact law must gate on
66 % this predicate. It
is the procid-level counterpart of the JAR
's
67 % Distribution.isMarkovian(), i.e. of the Markovian class hierarchy,
68 % so the two lists must stay in step.
69 bool = any(t == [ProcessType.EXP, ProcessType.ERLANG, ...
70 ProcessType.HYPEREXP, ProcessType.PH, ProcessType.APH, ...
71 ProcessType.MAP, ProcessType.COXIAN, ProcessType.COX2, ...
72 ProcessType.MMPP2, ProcessType.ME, ProcessType.RAP, ...
73 ProcessType.DMAP, ProcessType.BMAP, ProcessType.MMAP]);
76 function t = fromId(id)
86 function t = fromText(text)
87 % TIMMEDIATE = TOID(TYPE)
92 t = ProcessType.ERLANG;
94 t = ProcessType.HYPEREXP;
102 t = ProcessType.UNIFORM;
106 t = ProcessType.COXIAN;
108 t = ProcessType.GAMMA;
110 t = ProcessType.PARETO;
112 t = ProcessType.MMPP2;
113 case {'Replayer
', 'Trace
'}
114 t = ProcessType.REPLAYER;
116 t = ProcessType.IMMEDIATE;
118 t = ProcessType.DISABLED;
120 t = ProcessType.COX2;
122 t = ProcessType.WEIBULL;
124 t = ProcessType.LOGNORMAL;
125 case 'DiscreteUniform
'
126 t = ProcessType.DUNIFORM;
128 t = ProcessType.BERNOULLI;
130 t = ProcessType.PRIOR;
132 t = ProcessType.BINOMIAL;
134 t = ProcessType.POISSON;
136 t = ProcessType.GEOMETRIC;
138 t = ProcessType.BMAP;
140 % A CME is an ME: the concentrated representation is a
141 % subclass of ME and carries no distinct process type, so
142 % every solver gate and sn.procid entry that accepts ME
143 % accepts it. refreshProcessTypes passes the class name, so
144 % the subclass has to be listed here explicitly.
148 case 'DiscreteSampler
'
149 t = ProcessType.DISCRETESAMPLER;
151 t = ProcessType.ZIPF;
153 t = ProcessType.DMAP;
155 t = ProcessType.NHPP;
157 % Class name, as passed by refreshProcessTypes. Without this
158 % case an EmpiricalCDF service aborts fromText during
159 % getStruct, before any solver feature gate can report that
160 % the distribution is unsupported.
161 t = ProcessType.EMPIRICALCDF;
162 case {'MarkedMAP
', 'MMAP', 'MarkedMMPP
'}
163 t = ProcessType.MMAP;
165 line_error(mfilename, sprintf('Unrecognized process type: %s
', text));
169 function text = toText(t)
170 % TEXT = TOTEXT(TYPE)
174 case ProcessType.ERLANG
176 case ProcessType.HYPEREXP
184 case ProcessType.UNIFORM
188 case ProcessType.COXIAN
190 case ProcessType.GAMMA
192 case ProcessType.PARETO
194 case ProcessType.MMPP2
196 case {ProcessType.REPLAYER, ProcessType.TRACE}
198 case ProcessType.IMMEDIATE
200 case ProcessType.DISABLED
202 case ProcessType.COX2
204 case ProcessType.WEIBULL
206 case ProcessType.LOGNORMAL
208 case ProcessType.DUNIFORM
209 text = 'DiscreteUniform
';
210 case ProcessType.BERNOULLI
212 case ProcessType.PRIOR
214 case ProcessType.BINOMIAL
216 case ProcessType.POISSON
218 case ProcessType.GEOMETRIC
220 case ProcessType.BMAP
226 case ProcessType.DISCRETESAMPLER
227 text = 'DiscreteSampler
';
228 case ProcessType.ZIPF
230 case ProcessType.DMAP
232 case ProcessType.NHPP
234 case ProcessType.MMAP
236 case ProcessType.EMPIRICALCDF
237 text = 'EmpiricalCDF
';
242 text = sprintf('Unknown(%d)
', t);