Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 3442)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs	(revision 3452)
@@ -84,6 +84,6 @@
       get { return VisualizerParameter; }
     }
-    public ValueParameter<DoubleValue> BestKnownQualityParameter {
-      get { return (ValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
+    public OptionalValueParameter<DoubleValue> BestKnownQualityParameter {
+      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     }
     IParameter ISingleObjectiveProblem.BestKnownQualityParameter {
@@ -147,5 +147,5 @@
       Parameters.Add(new ValueParameter<SymbolicExpressionTreeCreator>("SolutionCreator", "The operator which should be used to create new symbolic regression solutions.", creator));
       Parameters.Add(new ValueParameter<ISymbolicRegressionEvaluator>("Evaluator", "The operator which should be used to evaluate symbolic regression solutions.", evaluator));
-      Parameters.Add(new ValueParameter<DoubleValue>("BestKnownQuality", "The minimal error value that can be reached by symbolic regression models.", new DoubleValue(0)));
+      Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The minimal error value that reached by symbolic regression solutions for the problem."));
       Parameters.Add(new ValueParameter<ISymbolicExpressionGrammar>("FunctionTreeGrammar", "The grammar that should be used for symbolic regression models.", globalGrammar));
       Parameters.Add(new ValueParameter<IntValue>("MaxExpressionLength", "Maximal length of the symbolic expression.", new IntValue(100)));
@@ -159,5 +159,4 @@
       creator.MaxFunctionArgumentsParameter.ActualName = "MaxFunctionArguments";
       creator.MaxFunctionDefinitionsParameter.ActualName = "MaxFunctionDefiningBranches";
-      evaluator.QualityParameter.ActualName = "TrainingMeanSquaredError";
       DataAnalysisProblemDataParameter.ValueChanged += new EventHandler(DataAnalysisProblemDataParameter_ValueChanged);
       DataAnalysisProblemData.ProblemDataChanged += new EventHandler(DataAnalysisProblemData_Changed);
@@ -169,13 +168,4 @@
     }
 
-    void DataAnalysisProblemDataParameter_ValueChanged(object sender, EventArgs e) {
-      DataAnalysisProblemData.ProblemDataChanged += new EventHandler(DataAnalysisProblemData_Changed);
-    }
-
-    void DataAnalysisProblemData_Changed(object sender, EventArgs e) {
-      foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable>()) {
-        varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.Select(x => x.Value);
-      }
-    }
 
     [StorableConstructor]
@@ -189,4 +179,29 @@
 
     #region Events
+    void DataAnalysisProblemDataParameter_ValueChanged(object sender, EventArgs e) {
+      DataAnalysisProblemData.ProblemDataChanged += new EventHandler(DataAnalysisProblemData_Changed);
+    }
+
+    void DataAnalysisProblemData_Changed(object sender, EventArgs e) {
+      foreach (var varSymbol in FunctionTreeGrammar.Symbols.OfType<HeuristicLab.Problems.DataAnalysis.Symbolic.Symbols.Variable>()) {
+        varSymbol.VariableNames = DataAnalysisProblemData.InputVariables.Select(x => x.Value);
+      }
+      UpdatePartitioningParameters();
+    }
+
+    private void UpdatePartitioningParameters() {
+      int trainingStart = DataAnalysisProblemData.TrainingSamplesStart.Value;
+      int validationEnd = DataAnalysisProblemData.TrainingSamplesEnd.Value;
+      int trainingEnd = trainingStart + (validationEnd - trainingStart) / 2;
+      int validationStart = trainingEnd;
+      var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer;
+      if (solutionVisualizer != null) {
+        solutionVisualizer.ValidationSamplesStartParameter.Value = new IntValue(validationStart);
+        solutionVisualizer.ValidationSamplesEndParameter.Value = new IntValue(validationEnd);
+      }
+      Evaluator.SamplesStartParameter.Value = new IntValue(trainingStart);
+      Evaluator.SamplesEndParameter.Value = new IntValue(trainingEnd);
+    }
+
     public event EventHandler SolutionCreatorChanged;
     private void OnSolutionCreatorChanged() {
@@ -269,6 +284,9 @@
     }
     private void ParameterizeEvaluator() {
-      Evaluator.FunctionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+      Evaluator.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
       Evaluator.RegressionProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+      Evaluator.QualityParameter.ActualName = "TrainingMeanSquaredError";
+      Evaluator.SamplesStartParameter.Value = new IntValue(DataAnalysisProblemData.TrainingSamplesStart.Value);
+      Evaluator.SamplesEndParameter.Value = new IntValue((DataAnalysisProblemData.TrainingSamplesStart.Value + DataAnalysisProblemData.TrainingSamplesEnd.Value) / 2);
     }
     private void ParameterizeVisualizer() {
@@ -278,4 +296,6 @@
           solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
           solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
+          solutionVisualizer.ValidationSamplesStartParameter.Value = new IntValue((DataAnalysisProblemData.TrainingSamplesStart.Value + DataAnalysisProblemData.TrainingSamplesEnd.Value) / 2);
+          solutionVisualizer.ValidationSamplesEndParameter.Value = new IntValue(DataAnalysisProblemData.TrainingSamplesEnd.Value);
         }
       }
@@ -289,5 +309,5 @@
       }
       foreach (ISymbolicRegressionEvaluator op in Operators.OfType<ISymbolicRegressionEvaluator>()) {
-        op.FunctionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
+        op.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;
         op.RegressionProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;
         op.NumberOfEvaluatedNodesParameter.ActualName = NumberOfEvaluatedNodesParameter.Name;
