Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Operators/BeforeManipulatorOperator.cs	(revision 13527)
@@ -52,5 +52,5 @@
 
     public override IOperation Apply() {
-      // since mutation always takes place after crossover, the vertex for the current child is already in the tree
+      // since mutation always takes place after crossover, the vertex for the current child is already in the graph
       var vChild = GenealogyGraph.GetByContent(ChildParameter.ActualValue);
       var vClone = (IGenealogyGraphNode<T>)vChild.Clone();
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisGeneticOperatorImprovementAnalyzer.cs	(revision 13527)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Collections.Generic;
 using System.Linq;
 using HeuristicLab.Analysis;
@@ -103,5 +104,21 @@
       var populationSize = population.Length;
 
-      var vertices = population.Select(graph.GetByContent).ToList();
+      //      var vertices = population.Select(graph.GetByContent).ToList();
+      var crossoverChildren = new List<IGenealogyGraphNode<ISymbolicExpressionTree>>();
+      var mutationChildren = new List<IGenealogyGraphNode<ISymbolicExpressionTree>>();
+      var vertices = graph.Vertices.Where(x => x.Rank > generation - 1);
+      foreach (var v in vertices) {
+        if (v.InDegree == 2) {
+          crossoverChildren.Add(v);
+        } else {
+          var parent = v.Parents.First();
+          // mutation is always preceded by mutation
+          // so the parent vertex should have an intermediate rank
+          // otherwise, it is the previos generation elite
+          if (parent.Rank.IsAlmost(generation - 1) && parent.IsElite)
+            continue;
+          mutationChildren.Add(v);
+        }
+      }
       DataTable table;
       #region crossover improvement
@@ -118,7 +135,4 @@
         table = (DataTable)Results["Crossover improvement"].Value;
       }
-      var crossoverChildren = vertices.Where(x => x.InDegree == 2).ToList();
-      if (CountIntermediateChildren)
-        crossoverChildren.AddRange(vertices.Where(x => x.InDegree == 1).Select(v => v.Parents.First()).Where(p => p.Rank.IsAlmost(generation - 0.5))); // add intermediate children
 
       var avgCrossoverParentQuality = crossoverChildren.SelectMany(x => x.Parents).Average(x => x.Quality);
@@ -148,6 +162,4 @@
       }
 
-      var mutationChildren = vertices.Where(x => x.InDegree == 1).ToList();
-
       var avgMutationParentQuality = mutationChildren.SelectMany(x => x.Parents).Average(x => x.Quality);
       var avgMutationChildQuality = mutationChildren.Average(x => x.Quality);
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 13527)
@@ -322,5 +322,5 @@
     <Compile Include="Tracking\SchemaDiversification\SchemaEvaluator.cs" />
     <Compile Include="Tracking\SchemaDiversification\SchemaCreator.cs" />
-    <Compile Include="Tracking\SchemaDiversification\UpdateEstimatedValuesOperator.cs" />
+    <Compile Include="Tracking\SchemaDiversification\UpdateQualityOperator.cs" />
     <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs" />
     <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs" />
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/DiversificationStatisticsOperator.cs	(revision 13527)
@@ -67,7 +67,12 @@
     }
 
+    public override void InitializeState() {
+      base.InitializeState();
+      evaluatedSolutionsTracker = 0;
+    }
+
     public override void ClearState() {
+      base.ClearState();
       evaluatedSolutionsTracker = 0;
-      base.ClearState();
     }
 
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaCreator.cs	(revision 13527)
@@ -111,5 +111,5 @@
     #endregion
 
-    private UpdateEstimatedValuesOperator updateEstimatedValuesOperator;
+    private UpdateQualityOperator updateQualityOperator;
     private DiversificationStatisticsOperator diversificationStatisticsOperator;
 
@@ -182,9 +182,9 @@
 
       var updateEstimatedValues = new OperationCollection { Parallel = true };
-      if (updateEstimatedValuesOperator == null)
-        updateEstimatedValuesOperator = new UpdateEstimatedValuesOperator();
+      if (updateQualityOperator == null)
+        updateQualityOperator = new UpdateQualityOperator();
 
       foreach (var s in ExecutionContext.Scope.SubScopes.Where(s => !s.Variables.ContainsKey("EstimatedValues"))) {
-        updateEstimatedValues.Add(ExecutionContext.CreateChildOperation(updateEstimatedValuesOperator, s));
+        updateEstimatedValues.Add(ExecutionContext.CreateChildOperation(updateQualityOperator, s));
       }
 
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 13526)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/SchemaEvaluator.cs	(revision 13527)
@@ -143,8 +143,9 @@
     };
 
+    [Storable]
     public ISymbolicExpressionTree Schema { get; set; }
 
     [Storable]
-    private readonly UpdateEstimatedValuesOperator updateEstimatedValuesOperator;
+    private readonly UpdateQualityOperator updateQualityOperator;
 
     [StorableHook(HookType.AfterDeserialization)]
@@ -156,5 +157,5 @@
     public SchemaEvaluator() {
       qm = new QueryMatch(comp) { MatchParents = true };
-      this.updateEstimatedValuesOperator = new UpdateEstimatedValuesOperator();
+      this.updateQualityOperator = new UpdateQualityOperator();
       #region add parameters
       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SchemaParameterName, "The current schema to be evaluated"));
@@ -185,11 +186,8 @@
 
     protected SchemaEvaluator(SchemaEvaluator original, Cloner cloner) : base(original, cloner) {
-      this.comp = original.comp == null ? new SymbolicExpressionTreeNodeEqualityComparer {
-        MatchConstantValues = false,
-        MatchVariableWeights = false,
-        MatchVariableNames = true
-      } : (ISymbolicExpressionTreeNodeEqualityComparer)original.comp.Clone();
+      this.comp = new SymbolicExpressionTreeNodeEqualityComparer();
       this.qm = new QueryMatch(comp) { MatchParents = original.qm?.MatchParents ?? true };
-      this.updateEstimatedValuesOperator = new UpdateEstimatedValuesOperator();
+      this.updateQualityOperator = new UpdateQualityOperator();
+      Schema = original.Schema;
     }
 
@@ -295,5 +293,5 @@
       foreach (var ind in individualsToReplace) {
         var mutatorOp = ExecutionContext.CreateChildOperation(mutator, ind);
-        var updateOp = ExecutionContext.CreateChildOperation(updateEstimatedValuesOperator, ind);
+        var updateOp = ExecutionContext.CreateChildOperation(updateQualityOperator, ind);
         mutationOc.Add(mutatorOp);
         updateEstimatedValues.Add(updateOp);
Index: anches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateEstimatedValuesOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateEstimatedValuesOperator.cs	(revision 13526)
+++ 	(revision )
@@ -1,125 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Linq;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
-using HeuristicLab.EvolutionTracking;
-using HeuristicLab.Parameters;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
-  [Item("UpdateEstimatedValuesOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")]
-  [StorableClass]
-  public class UpdateEstimatedValuesOperator : EvolutionTrackingOperator<ISymbolicExpressionTree> {
-    private const string ProblemDataParameterName = "ProblemData";
-    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
-    private const string EstimationLimitsParameterName = "EstimationLimits";
-    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
-    private const string ScaleEstimatedValuesParameterName = "ScaleEstimatedValues";
-
-    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
-      get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; }
-    }
-    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
-      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
-    }
-    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
-      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
-    }
-    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
-      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
-    }
-    public ILookupParameter<BoolValue> ScaleEstimatedValuesParameter {
-      get { return (ILookupParameter<BoolValue>)Parameters[ScaleEstimatedValuesParameterName]; }
-    }
-
-    public UpdateEstimatedValuesOperator() {
-      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName));
-      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
-      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
-      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
-      Parameters.Add(new LookupParameter<BoolValue>(ScaleEstimatedValuesParameterName));
-    }
-
-    [StorableConstructor]
-    protected UpdateEstimatedValuesOperator(bool deserializing) : base(deserializing) { }
-
-    protected UpdateEstimatedValuesOperator(UpdateEstimatedValuesOperator original, Cloner cloner) : base(original, cloner) {
-    }
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new UpdateEstimatedValuesOperator(this, cloner);
-    }
-
-    public override IOperation Apply() {
-      var tree = SymbolicExpressionTreeParameter.ActualValue;
-      var problemData = ProblemDataParameter.ActualValue;
-      var estimationLimits = EstimationLimitsParameter.ActualValue;
-      var interpreter = InterpreterParameter.ActualValue;
-
-      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndices).ToArray();
-      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
-
-      if (estimatedValues.Length != targetValues.Length)
-        throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
-
-      var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
-
-      for (int i = 0; i < estimatedValues.Length; ++i) {
-        var estimated = estimatedValues[i];
-        var target = targetValues[i];
-        if (!double.IsNaN(estimated) && !double.IsInfinity(estimated))
-          linearScalingCalculator.Add(estimated, target);
-      }
-      double alpha = linearScalingCalculator.Alpha;
-      double beta = linearScalingCalculator.Beta;
-      if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) {
-        alpha = 0.0;
-        beta = 1.0;
-      }
-      var scaled = estimatedValues.Select(x => x * beta + alpha).LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray();
-      OnlineCalculatorError error;
-      var r = OnlinePearsonsRCalculator.Calculate(targetValues, scaled, out error);
-      if (error != OnlineCalculatorError.None) r = double.NaN;
-
-      var r2 = r * r;
-
-      var variables = ExecutionContext.Scope.Variables;
-
-      ((DoubleValue)variables["Quality"].Value).Value = r2;
-
-      var scaleEstimatedValues = ScaleEstimatedValuesParameter.ActualValue;
-      if (!scaleEstimatedValues.Value)
-        scaled = estimatedValues.LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray();
-
-      if (variables.ContainsKey("EstimatedValues")) {
-        variables["EstimatedValues"].Value = new DoubleArray(scaled);
-      } else {
-        variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(scaled)));
-      }
-      return base.Apply();
-    }
-  }
-}
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs	(revision 13527)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Tracking/SchemaDiversification/UpdateQualityOperator.cs	(revision 13527)
@@ -0,0 +1,126 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.EvolutionTracking;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("UpdateQualityOperator", "Put the estimated values of the tree in the scope to be used by the phenotypic similarity calculator")]
+  [StorableClass]
+  public class UpdateQualityOperator : EvolutionTrackingOperator<ISymbolicExpressionTree> {
+    private const string ProblemDataParameterName = "ProblemData";
+    private const string InterpreterParameterName = "SymbolicExpressionTreeInterpreter";
+    private const string EstimationLimitsParameterName = "EstimationLimits";
+    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
+    private const string ScaleEstimatedValuesParameterName = "ScaleEstimatedValues";
+
+    public ILookupParameter<IRegressionProblemData> ProblemDataParameter {
+      get { return (ILookupParameter<IRegressionProblemData>)Parameters[ProblemDataParameterName]; }
+    }
+    public ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter> InterpreterParameter {
+      get { return (ILookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>)Parameters[InterpreterParameterName]; }
+    }
+    public ILookupParameter<DoubleLimit> EstimationLimitsParameter {
+      get { return (ILookupParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
+    }
+    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
+      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
+    }
+    public ILookupParameter<BoolValue> ScaleEstimatedValuesParameter {
+      get { return (ILookupParameter<BoolValue>)Parameters[ScaleEstimatedValuesParameterName]; }
+    }
+
+    public UpdateQualityOperator() {
+      Parameters.Add(new LookupParameter<IRegressionProblemData>(ProblemDataParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicDataAnalysisExpressionTreeInterpreter>(InterpreterParameterName));
+      Parameters.Add(new LookupParameter<DoubleLimit>(EstimationLimitsParameterName));
+      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName));
+      Parameters.Add(new LookupParameter<BoolValue>(ScaleEstimatedValuesParameterName));
+    }
+
+    [StorableConstructor]
+    protected UpdateQualityOperator(bool deserializing) : base(deserializing) { }
+
+    protected UpdateQualityOperator(UpdateQualityOperator original, Cloner cloner) : base(original, cloner) {
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new UpdateQualityOperator(this, cloner);
+    }
+
+    public override IOperation Apply() {
+      var tree = SymbolicExpressionTreeParameter.ActualValue;
+      var problemData = ProblemDataParameter.ActualValue;
+      var estimationLimits = EstimationLimitsParameter.ActualValue;
+      var interpreter = InterpreterParameter.ActualValue;
+
+      var estimatedValues = interpreter.GetSymbolicExpressionTreeValues(tree, problemData.Dataset, problemData.TrainingIndices).ToArray();
+      var targetValues = problemData.Dataset.GetDoubleValues(problemData.TargetVariable, problemData.TrainingIndices).ToArray();
+
+      if (estimatedValues.Length != targetValues.Length)
+        throw new ArgumentException("Number of elements in target and estimated values enumeration do not match.");
+
+      var linearScalingCalculator = new OnlineLinearScalingParameterCalculator();
+
+      for (int i = 0; i < estimatedValues.Length; ++i) {
+        var estimated = estimatedValues[i];
+        var target = targetValues[i];
+        if (!double.IsNaN(estimated) && !double.IsInfinity(estimated))
+          linearScalingCalculator.Add(estimated, target);
+      }
+      double alpha = linearScalingCalculator.Alpha;
+      double beta = linearScalingCalculator.Beta;
+      if (linearScalingCalculator.ErrorState != OnlineCalculatorError.None) {
+        alpha = 0.0;
+        beta = 1.0;
+      }
+      var scaled = estimatedValues.Select(x => x * beta + alpha).LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray();
+      OnlineCalculatorError error;
+      var r = OnlinePearsonsRCalculator.Calculate(targetValues, scaled, out error);
+      if (error != OnlineCalculatorError.None) r = double.NaN;
+
+      var r2 = r * r;
+
+      var variables = ExecutionContext.Scope.Variables;
+
+      ((DoubleValue)variables["Quality"].Value).Value = r2;
+      GenealogyGraph.GetByContent(tree).Quality = r2;
+
+      var scaleEstimatedValues = ScaleEstimatedValuesParameter.ActualValue;
+      if (!scaleEstimatedValues.Value)
+        scaled = estimatedValues.LimitToRange(estimationLimits.Lower, estimationLimits.Upper).ToArray();
+
+      if (variables.ContainsKey("EstimatedValues")) {
+        variables["EstimatedValues"].Value = new DoubleArray(scaled);
+      } else {
+        variables.Add(new Core.Variable("EstimatedValues", new DoubleArray(scaled)));
+      }
+      return base.Apply();
+    }
+  }
+}
