LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SchedStrategyType.m
1classdef (Sealed) SchedStrategyType
2 % Enumeration of scheduling strategy types
3 %
4 % Copyright (c) 2012-2026, Imperial College London
5 % All rights reserved.
6
7 properties (Constant)
8 NP = 0; % Non-preemptive
9 PR = 1; % Preemptive resume
10 PNR = 2; % Preemptive non-resume
11 NPPrio = 3; % Non-preemptive priority
12 PRPrio = 4; % Preemptive resume priority
13 PNRPrio = 5; % Preemptive non-resume priority
14 end
15
16 methods (Static)
17 function typeId = getTypeId(strategy)
18 % TYPEID = GETTYPEID(STRATEGY)
19 % Classifies the scheduling strategy type
20 switch strategy
21 case {SchedStrategy.PS, SchedStrategy.DPS, SchedStrategy.GPS, SchedStrategy.LPS}
22 typeId = SchedStrategyType.PR;
23 case {SchedStrategy.FCFS, SchedStrategy.SIRO, ...
24 SchedStrategy.SEPT, SchedStrategy.LEPT, ...
25 SchedStrategy.SJF, SchedStrategy.INF}
26 typeId = SchedStrategyType.NP;
27 case SchedStrategy.HOL
28 typeId = SchedStrategyType.NPPrio;
29 case SchedStrategy.PSPRIO
30 typeId = SchedStrategyType.PRPrio;
31 otherwise
32 line_error(mfilename, 'Unrecognized scheduling strategy type.');
33 end
34 end
35
36 function text = toText(type)
37 % TEXT = TOTEXT(TYPE)
38 switch type
39 case SchedStrategyType.NP
40 text = 'NonPreemptive';
41 case SchedStrategyType.PR
42 text = 'PreemptiveResume';
43 case SchedStrategyType.PNR
44 text = 'PreemptiveNonResume';
45 case SchedStrategyType.NPPrio
46 text = 'NonPreemptivePriority';
47 case SchedStrategyType.PRPrio
48 text = 'PreemptiveResumePriority';
49 case SchedStrategyType.PNRPrio
50 text = 'PreemptiveNonResumePriority';
51 otherwise
52 line_error(mfilename, 'Unrecognized scheduling strategy type.');
53 end
54 end
55 end
56
57 methods (Access = private)
58 function out = SchedStrategyType
59 % Prevent instantiation
60 end
61 end
62end