LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SignalType.m
1classdef (Sealed) SignalType
2 % Enumeration of signal types for signal classes.
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 NEGATIVE = 1; % Negative customer signal (removes jobs)
9 REPLY = 0; % Reply signal (triggers unblocking)
10 CATASTROPHE = 2; % Catastrophe signal (removes ALL jobs)
11 end
12
13 methods (Static)
14 function text = toText(type)
15 % TEXT = TOTEXT(TYPE)
16 switch type
17 case SignalType.NEGATIVE
18 text = 'negative';
19 case SignalType.REPLY
20 text = 'reply';
21 case SignalType.CATASTROPHE
22 text = 'catastrophe';
23 otherwise
24 line_error(mfilename, 'Unrecognized signal type.');
25 end
26 end
27
28 function type = fromText(text)
29 % TYPE = FROMTEXT(TEXT)
30 if iscell(text)
31 text = text{:};
32 end
33 switch lower(text)
34 case 'negative'
35 type = SignalType.NEGATIVE;
36 case 'reply'
37 type = SignalType.REPLY;
38 case 'catastrophe'
39 type = SignalType.CATASTROPHE;
40 otherwise
41 line_error(mfilename, 'Unrecognized signal type text.');
42 end
43 end
44 end
45end