Changeset 17892 for branches/3076_IA_evaluators_analyzers_reintegration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintEvaluator.cs
- Timestamp:
- 03/12/21 16:42:21 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3076_IA_evaluators_analyzers_reintegration/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintEvaluator.cs
r17878 r17892 1 1 using System; 2 using System.CodeDom;3 2 using System.Collections.Generic; 4 3 using System.Linq; 5 using System.Text;6 using System.Threading.Tasks;7 4 using HEAL.Attic; 8 5 using HeuristicLab.Common; … … 96 93 "Define whether the constraints are penalized by soft or hard constraints.", new BoolValue(false))); 97 94 Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName, 98 "Select the Boundsestimator.", new I ABoundsEstimator()));95 "Select the Boundsestimator.", new IntervalArithBoundsEstimator())); 99 96 Parameters.Add(new FixedValueParameter<DoubleValue>(MaximumPenaltyFactorParamterName, 100 97 "Specify how hard constraints violations should be punished", new DoubleValue(1.5))); … … 120 117 if (!Parameters.ContainsKey(BoundsEstimatorParameterName)) 121 118 Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName, 122 "Select the Boundsestimator.", new I ABoundsEstimator()));119 "Select the Boundsestimator.", new IntervalArithBoundsEstimator())); 123 120 124 121 if (!Parameters.ContainsKey(MaximumPenaltyFactorParamterName)) { … … 197 194 var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows); 198 195 var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows); 199 var constraints = problemData. IntervalConstraints.EnabledConstraints;196 var constraints = problemData.ShapeConstraints.EnabledConstraints; 200 197 var intervalCollection = problemData.VariableRanges; 201 198 … … 208 205 } 209 206 210 var constraintResults = IntervalUtil. IntervalConstraintsViolation(constraints, estimator, intervalCollection, solution);207 var constraintResults = IntervalUtil.GetConstraintViolations(constraints, estimator, intervalCollection, solution); 211 208 212 209 if (constraintResults.Any(x => double.IsNaN(x) || double.IsInfinity(x))) { … … 217 214 if (useSoftConstraints) { 218 215 if (maximumPenaltyFactor < 0.0) 219 throw new ArgumentException("The parameter 'Maximum Penalty Factor' has to be greater or equal 0.0!");216 throw new ArgumentException("The parameter has to be greater or equal 0.0!", nameof(maximumPenaltyFactor)); 220 217 221 218 var zip = constraints.Zip(constraintResults, (c, e) => new { Constraint = c, Error = e });
Note: See TracChangeset
for help on using the changeset viewer.