LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
ImpatienceType.m
1classdef (Sealed) ImpatienceType
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 (timer-based)
9 BALKING = 2; % Customer refuses to join based on queue state
10 RETRIAL = 3; % Customer moves to orbit and retries after delay
11 end
12
13 methods (Static)
14 function text = toText(type)
15 % TEXT = TOTEXT(TYPE)
16 %
17 % Convert impatience type constant to text description
18 switch type
19 case ImpatienceType.RENEGING
20 text = 'reneging';
21 case ImpatienceType.BALKING
22 text = 'balking';
23 case ImpatienceType.RETRIAL
24 text = 'retrial';
25 otherwise
26 line_error(mfilename, 'Unrecognized impatience type.');
27 end
28 end
29
30 function id = toId(type)
31 % ID = TOID(TYPE)
32 %
33 % Convert impatience type constant to numeric ID
34 id = type;
35 end
36
37 function type = fromId(id)
38 % TYPE = FROMID(ID)
39 %
40 % Convert numeric ID to impatience type constant
41 switch id
42 case 1
43 type = ImpatienceType.RENEGING;
44 case 2
45 type = ImpatienceType.BALKING;
46 case 3
47 type = ImpatienceType.RETRIAL;
48 otherwise
49 line_error(mfilename, sprintf('Unrecognized impatience type ID: %d', id));
50 end
51 end
52 end
53end