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',...
42 'StatelessClassSwitcher',...
43 'CacheClassSwitcher',...
60 'RoutingStrategy_PROB', ...
61 'RoutingStrategy_RAND', ...
62 'RoutingStrategy_RROBIN', ...
63 'RoutingStrategy_WRROBIN', ...
64 'RoutingStrategy_KCHOICES', ...
65 'SchedStrategy_INF', ...
66 'SchedStrategy_FCFS', ...
67 'SchedStrategy_LCFS', ...
68 'SchedStrategy_LCFSPI', ...
69 'SchedStrategy_LCFSPR', ...
70 'SchedStrategy_FCFSPR', ...
71 'SchedStrategy_FCFSPI', ...
72 'SchedStrategy_SEPT', ...
73 'SchedStrategy_LEPT', ...
74 'SchedStrategy_DPS', ...
75 'SchedStrategy_GPS', ...
76 'SchedStrategy_LJF', ...
77 'SchedStrategy_LPS', ...
78 'SchedStrategy_SJF', ...
79 'SchedStrategy_SRPT', ...
80 'SchedStrategy_SRPTPRIO', ...
81 'SchedStrategy_PS', ...
82 'SchedStrategy_SIRO', ...
83 'SchedStrategy_HOL', ...
84 'SchedStrategy_EXT', ...
85 'SchedStrategy_POLLING', ...
86 'ReplacementStrategy_RR', ...
87 'ReplacementStrategy_FIFO', ...
88 'ReplacementStrategy_SFIFO', ...
89 'ReplacementStrategy_LRU', ...
95 function self = SolverFeatureSet()
96 % SELF = SOLVERFEATURESET()
99 fields = SolverFeatureSet.fields;
100 for f=1:length(fields)
101 self.list.(fields{f})=
false;
105 function self = setTrue(self, feature)
106 % SELF = SETTRUE(FEATURE)
109 for c=1:length(feature)
110 self.setTrue(feature{c});
113 if ~strcmpi(feature,
'char') % ignore empty sections
114 self.list.(feature) =
true;
119 function self = setFalse(self, feature)
120 % SELF = SETFALSE(FEATURE)
123 for c=1:length(feature)
124 self.setFalse(feature{c});
127 self.list.(feature) =
false;
134 function
bool = supports(featSupportedList, featUsedList)
135 % BOOL = SUPPORTS(FEATSUPPORTEDLIST, FEATUSEDLIST)
141 fields = SolverFeatureSet.fields;
142 for f=1:length(fields)
143 if featUsedList.list.(fields{f}) > featSupportedList.list.(fields{f})
145 unsupported{end+1} = fields{f}; %#ok<AGROW>
149 if ~isempty(unsupported)
150 str=
'Some features are not supported by the chosen solver (feature: ';
151 for u=1:length(unsupported)
153 str = sprintf(
'%s%s',str,unsupported{u});
155 str = sprintf(
'%s, %s',str,unsupported{u});
158 str = sprintf(
'%s).\n',str);
159 line_warning(mfilename,str);