Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/21 16:07:45 (2 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into branch.

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/ShapeConstraintsAnalyzer.cs

    r17903 r18086  
    3131namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
    3232  [StorableType("4318C6BD-E0A1-45FE-AC30-96E7F73B51FB")]
    33   [Item("Shape-constraints analyser", "Analyzes the number of shape-constraint violations of symbolic regression models.")]
     33  [Item("ShapeConstraintsAnalyzer", "Analyzes the number of shape constraint violations of symbolic regression models.")]
    3434  public class ShapeConstraintsAnalyzer : SymbolicDataAnalysisAnalyzer, ISymbolicExpressionTreeAnalyzer {
    3535    private const string ProblemDataParameterName = "ProblemData";
     
    9797
    9898    public override IOperation Apply() {
    99       var problemData = RegressionProblemData;
     99      var problemData = (IShapeConstrainedRegressionProblemData)RegressionProblemData;
    100100      var trees = SymbolicExpressionTree.ToArray();
    101101
     
    106106      var estimator = new IntervalArithBoundsEstimator();
    107107
    108       if (constraintViolationsTable.Rows.Any())
     108      if (!constraintViolationsTable.Rows.Any())
    109109        foreach (var constraint in constraints)
    110110          constraintViolationsTable.Rows.Add(new DataRow(constraint.ToString()));
     
    115115      }
    116116
    117       var constraintUnsatisfiedSolutionsDataTable = InfeasibleSolutions;
    118       if (constraintUnsatisfiedSolutionsDataTable.Rows.Count == 0)
    119         constraintUnsatisfiedSolutionsDataTable.Rows.Add(new DataRow(InfeasibleSolutionsParameterName));
     117      var infeasibleSolutionsDataTable = InfeasibleSolutions;
     118      if (infeasibleSolutionsDataTable.Rows.Count == 0)
     119        infeasibleSolutionsDataTable.Rows.Add(new DataRow(InfeasibleSolutionsParameterName));
    120120
    121       constraintUnsatisfiedSolutionsDataTable.Rows[InfeasibleSolutionsParameterName]
     121      infeasibleSolutionsDataTable.Rows[InfeasibleSolutionsParameterName]
    122122        .Values
    123123        .Add(trees.Count(t => IntervalUtil.GetConstraintViolations(constraints, estimator, variableRanges, t).Any(x => x > 0.0)));
Note: See TracChangeset for help on using the changeset viewer.