LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
PatienceType.m
1classdef (Sealed) PatienceType
2 % Enumeration of customer impatience types.
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 RENEGING = 1; % Customer abandons after joining the queue (currently supported)
9 BALKING = 2; % Customer refuses to join based on queue state (future support)
10 end
11
12 methods (Static)
13 function text = toText(type)
14 % TEXT = TOTEXT(TYPE)
15 %
16 % Convert patience type constant to text description
17 switch type
18 case PatienceType.RENEGING
19 text = 'reneging';
20 case PatienceType.BALKING
21 text = 'balking';
22 otherwise
23 line_error(mfilename, 'Unrecognized patience type.');
24 end
25 end
26
27 function id = toId(type)
28 % ID = TOID(TYPE)
29 %
30 % Convert patience type constant to numeric ID
31 id = type;
32 end
33
34 function type = fromId(id)
35 % TYPE = FROMID(ID)
36 %
37 % Convert numeric ID to patience type constant
38 switch id
39 case 1
40 type = PatienceType.RENEGING;
41 case 2
42 type = PatienceType.BALKING;
43 otherwise
44 line_error(mfilename, sprintf('Unrecognized patience type ID: %d', id));
45 end
46 end
47 end
48end