LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
SystemResponseTimeConstraint.m
1classdef SystemResponseTimeConstraint < opt.Constraint
2 % SystemResponseTimeConstraint End-to-end response time: SysRespT <= maxValue.
3 properties
4 jobclass = '';
5 maxValue
6 end
7 methods
8 function obj = SystemResponseTimeConstraint(jobclass, maxValue, name)
9 if nargin < 3, name = ''; end
10 obj@opt.Constraint(name);
11 if nargin >= 1 && ~isempty(jobclass)
12 obj.jobclass = opt.Constraint.nameOf(jobclass);
13 end
14 obj.maxValue = maxValue;
15 end
16 function n = generateName(obj)
17 if ~isempty(obj.jobclass)
18 n = sprintf('SysRT_%s_le_%g', obj.jobclass, obj.maxValue);
19 else
20 n = sprintf('SysRT_le_%g', obj.maxValue);
21 end
22 end
23 function v = evaluate(obj, result, ~)
24 if ~isempty(obj.jobclass)
25 actual = result.getSystemResponseTime(obj.jobclass);
26 else
27 actual = result.getSystemResponseTime();
28 end
29 v = opt.Constraint.upperBoundViolation(actual, obj.maxValue);
30 end
31 end
32end