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, 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;
32 otherwise
33 line_error(mfilename, 'Unrecognized scheduling strategy type.');
34 end
35 end
36
37 function text = toText(type)
38 % TEXT = TOTEXT(TYPE)
39 switch 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';
52 otherwise
53 line_error(mfilename, 'Unrecognized scheduling strategy type.');
54 end
55 end
56 end
57
58 methods (Access = private)
59 function out = SchedStrategyType
60 % Prevent instantiation
61 end
62 end
63end
Definition Station.m:245