1classdef (Sealed) SchedStrategyType
2 % Enumeration of scheduling strategy types
4 % Copyright (c) 2012-2026, Imperial College London
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
17 function typeId = getTypeId(strategy)
18 % TYPEID = GETTYPEID(STRATEGY)
19 % Classifies
the scheduling strategy type
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, SchedStrategy.SETF, ...
26 SchedStrategy.PAS, SchedStrategy.OI}
27 typeId = SchedStrategyType.NP;
28 case SchedStrategy.HOL
29 typeId = SchedStrategyType.NPPrio;
30 case SchedStrategy.PSPRIO
31 typeId = SchedStrategyType.PRPrio;
33 line_error(mfilename,
'Unrecognized scheduling strategy type.');
37 function text = toText(type)
40 case SchedStrategyType.NP
41 text =
'NonPreemptive';
42 case SchedStrategyType.PR
43 text =
'PreemptiveResume';
44 case SchedStrategyType.PNR
45 text =
'PreemptiveNonResume';
46 case SchedStrategyType.NPPrio
47 text =
'NonPreemptivePriority';
48 case SchedStrategyType.PRPrio
49 text =
'PreemptiveResumePriority';
50 case SchedStrategyType.PNRPrio
51 text =
'PreemptiveNonResumePriority';
53 line_error(mfilename,
'Unrecognized scheduling strategy type.');
58 methods (Access =
private)
59 function out = SchedStrategyType
60 % Prevent instantiation