Index: /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 17620)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.csproj	(revision 17621)
@@ -173,4 +173,6 @@
     <Compile Include="SingleObjective\ConstantOptimizationAnalyzer.cs" />
     <Compile Include="SingleObjective\Evaluators\SymbolicRegressionMeanRelativeErrorEvaluator.cs" />
+    <Compile Include="SingleObjective\Evaluators\SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs" />
+    <Compile Include="SingleObjective\Evaluators\SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs" />
     <Compile Include="SingleObjective\SymbolicRegressionSolutionsAnalyzer.cs" />
     <Compile Include="SymbolicRegressionConstraintAnalyzer.cs" />
Index: /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17621)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator.cs	(revision 17621)
@@ -0,0 +1,74 @@
+﻿using System.Collections.Generic;
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
+  [Item("Constraint ConstOpt Evaluator", "")]
+  [StorableType("4170FD8B-DDD9-43B7-8BF8-F9C7290D4D1C")]
+  public class SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator : SymbolicRegressionSingleObjectiveEvaluator {
+    [StorableConstructor]
+    protected SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator(StorableConstructorFlag _) : base(_) { }
+
+    protected SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator(
+      SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator(this, cloner);
+    }
+
+    public SymbolicRegressionSingleObjectiveConstraintConstOptEvaluator() { }
+
+    public override bool Maximization => true;
+
+    public override IOperation InstrumentedApply() {
+      var solution = SymbolicExpressionTreeParameter.ActualValue;
+      var rows     = GenerateRowsToEvaluate();
+
+      var quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution,
+                              EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
+                              ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value);
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.InstrumentedApply();
+    }
+
+    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                   ISymbolicExpressionTree tree, double lowerEstimationLimit,
+                                   double upperEstimationLimit, IRegressionProblemData problemData,
+                                   IEnumerable<int> rows, bool applyLinearScaling) {
+      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, rows);
+      var targetValues    = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
+
+      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
+      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
+
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) return 0;
+
+      var r2 = SymbolicRegressionConstantOptimizationEvaluator.OptimizeConstants(interpreter, tree, problemData,
+                                                                                 problemData.TrainingIndices,
+                                                                                 applyLinearScaling, 10);
+      return r2;
+    }
+
+    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree,
+                                    IRegressionProblemData problemData, IEnumerable<int> rows) {
+      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
+      EstimationLimitsParameter.ExecutionContext                    = context;
+      ApplyLinearScalingParameter.ExecutionContext                  = context;
+
+      var r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
+                         EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
+                         problemData, rows,
+                         ApplyLinearScalingParameter.ActualValue.Value);
+
+      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
+      EstimationLimitsParameter.ExecutionContext                    = null;
+      ApplyLinearScalingParameter.ExecutionContext                  = null;
+
+      return r2;
+    }
+  }
+}
Index: /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs
===================================================================
--- /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17621)
+++ /branches/3076_IA_evaluators_analyzers/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator.cs	(revision 17621)
@@ -0,0 +1,81 @@
+﻿using System.Collections.Generic;
+using HEAL.Attic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Regression {
+  [Item("Pearson R² Constraint Evaluator",
+    "Calculates the square of the pearson correlation coefficient (also known as coefficient of determination) of a symbolic regression solution.")]
+  [StorableType("D61462E4-2032-4790-B63D-5E6512987F64")]
+  public class SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator : SymbolicRegressionSingleObjectiveEvaluator {
+    [StorableConstructor]
+    protected SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator(StorableConstructorFlag _) :
+      base(_) { }
+
+    protected SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator(
+      SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator(this, cloner);
+    }
+
+    public SymbolicRegressionSingleObjectiveConstraintPearsonRSquaredEvaluator() { }
+
+    public override bool Maximization => true;
+
+    public override IOperation InstrumentedApply() {
+      var solution = SymbolicExpressionTreeParameter.ActualValue;
+      var rows     = GenerateRowsToEvaluate();
+
+      var quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution,
+                              EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
+                              ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value);
+      QualityParameter.ActualValue = new DoubleValue(quality);
+      return base.InstrumentedApply();
+    }
+
+    public static double Calculate(ISymbolicDataAnalysisExpressionTreeInterpreter interpreter,
+                                   ISymbolicExpressionTree solution, double lowerEstimationLimit,
+                                   double upperEstimationLimit, IRegressionProblemData problemData,
+                                   IEnumerable<int> rows, bool applyLinearScaling) {
+      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(solution, problemData.Dataset, rows);
+      var targetValues    = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, rows);
+      var errorState      = OnlineCalculatorError.None;
+
+      var constraints    = problemData.IntervalConstraints.EnabledConstraints;
+      var variableRanges = problemData.VariableRanges.GetReadonlyDictionary();
+      var tree           = solution;
+
+      if (!SymbolicRegressionConstraintAnalyzer.ConstraintsSatisfied(constraints, variableRanges, tree)) return 0;
+
+      var r2 = SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.Calculate(interpreter, solution,
+                                                                                   lowerEstimationLimit,
+                                                                                   upperEstimationLimit, problemData,
+                                                                                   rows, applyLinearScaling);
+
+      return r2;
+    }
+
+
+    public override double Evaluate(IExecutionContext context, ISymbolicExpressionTree tree,
+                                    IRegressionProblemData problemData, IEnumerable<int> rows) {
+      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = context;
+      EstimationLimitsParameter.ExecutionContext                    = context;
+      ApplyLinearScalingParameter.ExecutionContext                  = context;
+
+      var r2 = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, tree,
+                         EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper,
+                         problemData, rows,
+                         ApplyLinearScalingParameter.ActualValue.Value);
+
+      SymbolicDataAnalysisTreeInterpreterParameter.ExecutionContext = null;
+      EstimationLimitsParameter.ExecutionContext                    = null;
+      ApplyLinearScalingParameter.ExecutionContext                  = null;
+
+      return r2;
+    }
+  }
+}
