1classdef SolverFeatureSet < handle
2 % An auxiliary
class to specify the features supported by a solver.
4 % Copyright (c) 2012-2026, Imperial College London
8 list; % list of features
12 fields = {
'ClassSwitch',...
43 'StatelessClassSwitcher',...
44 'CacheClassSwitcher',...
61 'RoutingStrategy_PROB', ...
62 'RoutingStrategy_RAND', ...
63 'RoutingStrategy_RROBIN', ...
64 'RoutingStrategy_WRROBIN', ...
65 'RoutingStrategy_KCHOICES', ...
66 'SchedStrategy_INF', ...
67 'SchedStrategy_FCFS', ...
68 'SchedStrategy_LCFS', ...
69 'SchedStrategy_LCFSPI', ...
70 'SchedStrategy_LCFSPR', ...
71 'SchedStrategy_FCFSPR', ...
72 'SchedStrategy_FCFSPI', ...
73 'SchedStrategy_SEPT', ...
74 'SchedStrategy_LEPT', ...
75 'SchedStrategy_DPS', ...
76 'SchedStrategy_GPS', ...
77 'SchedStrategy_LJF', ...
78 'SchedStrategy_LPS', ...
79 'SchedStrategy_SJF', ...
80 'SchedStrategy_SRPT', ...
81 'SchedStrategy_SRPTPRIO', ...
82 'SchedStrategy_PS', ...
83 'SchedStrategy_SIRO', ...
84 'SchedStrategy_HOL', ...
85 'SchedStrategy_EXT', ...
86 'SchedStrategy_POLLING', ...
87 'ReplacementStrategy_RR', ...
88 'ReplacementStrategy_FIFO', ...
89 'ReplacementStrategy_SFIFO', ...
90 'ReplacementStrategy_LRU', ...
96 function self = SolverFeatureSet()
97 % SELF = SOLVERFEATURESET()
100 fields = SolverFeatureSet.fields;
101 for f=1:length(fields)
102 self.list.(fields{f})=
false;
106 function self = setTrue(self, feature)
107 % SELF = SETTRUE(FEATURE)
110 for c=1:length(feature)
111 self.setTrue(feature{c});
114 if ~strcmpi(feature,
'char') % ignore empty sections
115 self.list.(feature) =
true;
120 function self = setFalse(self, feature)
121 % SELF = SETFALSE(FEATURE)
124 for c=1:length(feature)
125 self.setFalse(feature{c});
128 self.list.(feature) =
false;
135 function
bool = supports(featSupportedList, featUsedList)
136 % BOOL = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
142 fields = SolverFeatureSet.fields;
143 for f=1:length(fields)
144 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
146 unsupported{end+1} = fields{f}; %#ok<AGROW>
150 if ~isempty(unsupported)
151 str=
'Some features are not supported by the chosen solver (feature: ';
152 for u=1:length(unsupported)
154 str = sprintf(
'%s%s',str,unsupported{u});
156 str = sprintf(
'%s, %s',str,unsupported{u});
159 str = sprintf(
'%s).\n',str);
160 line_warning(mfilename,str);