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}
26 typeId = SchedStrategyType.NP;
27 case SchedStrategy.HOL
28 typeId = SchedStrategyType.NPPrio;
29 case SchedStrategy.PSPRIO
30 typeId = SchedStrategyType.PRPrio;
32 line_error(mfilename,
'Unrecognized scheduling strategy type.');
36 function text = toText(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';
52 line_error(mfilename,
'Unrecognized scheduling strategy type.');
57 methods (Access =
private)
58 function out = SchedStrategyType
59 % Prevent instantiation