Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/12/21 16:42:21 (3 years ago)
Author:
gkronber
Message:

#3076: refactoring to prepare for trunk reintegration

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  
    11using System;
    2 using System.CodeDom;
    32using System.Collections.Generic;
    43using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    74using HEAL.Attic;
    85using HeuristicLab.Common;
     
    9693        "Define whether the constraints are penalized by soft or hard constraints.", new BoolValue(false)));
    9794      Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName,
    98         "Select the Boundsestimator.", new IABoundsEstimator()));
     95        "Select the Boundsestimator.", new IntervalArithBoundsEstimator()));
    9996      Parameters.Add(new FixedValueParameter<DoubleValue>(MaximumPenaltyFactorParamterName,
    10097        "Specify how hard constraints violations should be punished", new DoubleValue(1.5)));
     
    120117      if (!Parameters.ContainsKey(BoundsEstimatorParameterName))
    121118        Parameters.Add(new ValueParameter<IBoundsEstimator>(BoundsEstimatorParameterName,
    122           "Select the Boundsestimator.", new IABoundsEstimator()));
     119          "Select the Boundsestimator.", new IntervalArithBoundsEstimator()));
    123120
    124121      if (!Parameters.ContainsKey(MaximumPenaltyFactorParamterName)) {
     
    197194      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
    198195      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
    199       var constraints = problemData.IntervalConstraints.EnabledConstraints;
     196      var constraints = problemData.ShapeConstraints.EnabledConstraints;
    200197      var intervalCollection = problemData.VariableRanges;
    201198
     
    208205      }
    209206
    210       var constraintResults = IntervalUtil.IntervalConstraintsViolation(constraints, estimator, intervalCollection, solution);
     207      var constraintResults = IntervalUtil.GetConstraintViolations(constraints, estimator, intervalCollection, solution);
    211208
    212209      if (constraintResults.Any(x => double.IsNaN(x) || double.IsInfinity(x))) {
     
    217214      if (useSoftConstraints) {
    218215        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));
    220217
    221218        var zip = constraints.Zip(constraintResults, (c, e) => new { Constraint = c, Error = e });
Note: See TracChangeset for help on using the changeset viewer.