Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj	(revision 11927)
@@ -199,5 +199,5 @@
     <Compile Include="Interfaces\ISymbolicExpressionTreeGrammar.cs" />
     <Compile Include="Interfaces\ISymbolicExpressionTreeNodeComparer.cs" />
-    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeSimilarityComparer.cs" />
+    <Compile Include="Interfaces\ISymbolicExpressionTreeNodeEqualityComparer.cs" />
     <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeArchitectureAlteringOperator.cs" />
     <Compile Include="Interfaces\Operators\ISymbolicExpressionTreeGrammarBasedOperator.cs" />
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs	(revision 11927)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeEqualityComparer.cs	(revision 11927)
@@ -0,0 +1,10 @@
+﻿using System.Collections.Generic;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
+  public interface ISymbolicExpressionTreeNodeEqualityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem {
+    bool MatchConstantValues { get; set; }
+    bool MatchVariableWeights { get; set; }
+    bool MatchVariableNames { get; set; }
+  }
+}
Index: anches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeSimilarityComparer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/ISymbolicExpressionTreeNodeSimilarityComparer.cs	(revision 11926)
+++ 	(revision )
@@ -1,10 +1,0 @@
-﻿using System.Collections.Generic;
-using HeuristicLab.Core;
-
-namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
-  public interface ISymbolicExpressionTreeNodeSimilarityComparer : IEqualityComparer<ISymbolicExpressionTreeNode>, IItem {
-    bool MatchConstantValues { get; set; }
-    bool MatchVariableWeights { get; set; }
-    bool MatchVariableNames { get; set; }
-  }
-}
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymbolicDataAnalysisGenealogyGraphView.cs	(revision 11927)
@@ -37,9 +37,9 @@
   [Content(typeof(IGenealogyGraph<ISymbolicExpressionTree>), IsDefaultView = true)]
   public partial class SymbolicDataAnalysisGenealogyGraphView : SymbolicDataAnalysisGenealogyGraphViewDesignable {
-    private readonly ISymbolicExpressionTreeNodeSimilarityComparer comparer;
+    private readonly ISymbolicExpressionTreeNodeEqualityComparer comparer;
 
     public SymbolicDataAnalysisGenealogyGraphView() {
       InitializeComponent();
-      comparer = new SymbolicExpressionTreeNodeSimilarityComparer();
+      comparer = new SymbolicExpressionTreeNodeEqualityComparer();
       viewHost.ViewType = typeof(GraphicalSymbolicExpressionTreeView);
     }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisBottomUpDiversityAnalyzer.cs	(revision 11927)
@@ -45,5 +45,5 @@
       set {
         MatchConstantValuesParameter.Value.Value = value;
-        ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value;
+        ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchConstantValues = value;
       }
     }
@@ -53,5 +53,5 @@
       set {
         MatchVariableWeightsParameter.Value.Value = value;
-        ((BottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value;
+        ((SymbolicExpressionTreeBottomUpSimilarityCalculator)SimilarityCalculator).MatchVariableWeights = value;
       }
     }
@@ -69,5 +69,5 @@
 
     public SymbolicDataAnalysisBottomUpDiversityAnalyzer() {
-      SimilarityCalculator = new BottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
+      SimilarityCalculator = new SymbolicExpressionTreeBottomUpSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
       Parameters.Add(new ValueParameter<BoolValue>(MatchConstantValuesParameterName, "Specifies if the similarity calculator should match constant values.", new BoolValue(true)));
       Parameters.Add(new ValueParameter<BoolValue>(MatchVariableWeightsParameterName, "Specifies if the similarity calculator should match variable weights", new BoolValue(true)));
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Analyzers/SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer.cs	(revision 11927)
@@ -32,5 +32,5 @@
 
     public SymbolicDataAnalysisMaxCommonSubtreeDiversityAnalyzer() {
-      SimilarityCalculator = new MaxCommonSubtreeSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
+      SimilarityCalculator = new SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator { SolutionVariableName = "SymbolicExpressionTree" };
     }
   }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/SymbolicDataAnalysisExpressionDiversityPreservingCrossover.cs	(revision 11927)
@@ -54,5 +54,5 @@
     public SymbolicDataAnalysisExpressionDiversityPreservingCrossover() {
       Parameters.Add(new ValueLookupParameter<PercentValue>(InternalCrossoverPointProbabilityParameterName, "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9)));
-      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionSimilarityCalculator>(SimilarityCalculatorParameterName, "The similarity calculator", new BottomUpSimilarityCalculator()));
+      Parameters.Add(new ValueParameter<ISymbolicDataAnalysisExpressionSimilarityCalculator>(SimilarityCalculatorParameterName, "The similarity calculator", new SymbolicExpressionTreeBottomUpSimilarityCalculator()));
     }
 
@@ -78,5 +78,5 @@
       var left = actualRoot.GetSubtree(0);
       var right = actualRoot.GetSubtree(1);
-      var bus = (BottomUpSimilarityCalculator)similarityCalculator;
+      var bus = (SymbolicExpressionTreeBottomUpSimilarityCalculator)similarityCalculator;
       var map = bus.ComputeBottomUpMapping(left, right);
 
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 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 11927)
@@ -204,7 +204,6 @@
     <Compile Include="Importer\Token.cs" />
     <Compile Include="Interfaces\IModelBacktransformator.cs" />
-    <Compile Include="SimilarityCalculators\BottomUpSimilarityCalculator.cs" />
-    <Compile Include="SimilarityCalculators\MaxCommonSubtreeSimilarityCalculator.cs" />
-    <Compile Include="SimilarityCalculators\PhenotypicSimilarityCalculator.cs" />
+    <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionSimilarityCalculator.cs" />
+    <Compile Include="TreeMatching\SymbolicExpressionTreePhenotypicSimilarityCalculator.cs" />
     <Compile Include="SymbolicExpressionTreeBacktransformator.cs" />
     <Compile Include="SlidingWindow\GenerationalSlidingWindowAnalyzer.cs" />
@@ -312,4 +311,8 @@
     <Compile Include="Symbols\VariableConditionTreeNode.cs" />
     <Compile Include="Symbols\VariableTreeNode.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterCrossoverOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionAfterManipulatorOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeCrossoverOperator.cs" />
+    <Compile Include="Tracking\SymbolicDataAnalysisExpressionBeforeManipulatorOperator.cs" />
     <Compile Include="Tracking\TraceCalculator.cs" />
     <Compile Include="TransformationToSymbolicTreeMapper.cs" />
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeBottomUpSimilarityCalculator.cs	(revision 11927)
@@ -34,5 +34,5 @@
   [StorableClass]
   [Item("SymbolicExpressionTreeBottomUpSimilarityCalculator", "A similarity calculator which uses the tree bottom-up distance as a similarity metric.")]
-  public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
+  public class SymbolicExpressionTreeBottomUpSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator, ISymbolicDataAnalysisExpressionSimilarityCalculator {
     private readonly HashSet<string> commutativeSymbols = new HashSet<string> { "Addition", "Multiplication", "Average", "And", "Or", "Xor" };
     public bool MatchVariableWeights { get; set; }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMatching.cs	(revision 11927)
@@ -30,12 +30,12 @@
 namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
   public static class SymbolicExpressionTreeMatching {
-    public static bool ContainsSubtree(this ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comparer) {
+    public static bool ContainsSubtree(this ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
       return FindMatches(root, subtree, comparer).Any();
     }
-    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comparer) {
+    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTree tree, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
       return FindMatches(tree.Root, subtree, comparer);
     }
 
-    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, SymbolicExpressionTreeNodeEqualityComparer comp) {
+    public static IEnumerable<ISymbolicExpressionTreeNode> FindMatches(ISymbolicExpressionTreeNode root, ISymbolicExpressionTreeNode subtree, ISymbolicExpressionTreeNodeEqualityComparer comp) {
       var fragmentLength = subtree.GetLength();
       // below, we use ">=" for Match(n, subtree, comp) >= fragmentLength because in case of relaxed conditions, 
@@ -52,5 +52,5 @@
     /// </summary>
     /// <returns>Number of pairs that were matched</returns>
-    public static int Match(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, ISymbolicExpressionTreeNodeSimilarityComparer comp) {
+    public static int Match(ISymbolicExpressionTreeNode a, ISymbolicExpressionTreeNode b, ISymbolicExpressionTreeNodeEqualityComparer comp) {
       if (!comp.Equals(a, b)) return 0;
       int m = a.SubtreeCount;
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator.cs	(revision 11927)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator", "A similarity calculator based on the size of the maximum common subtree between two trees")]
-  public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator {
+  public class SymbolicExpressionTreeMaxCommonSubtreeSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator, ISymbolicDataAnalysisExpressionSimilarityCalculator {
     [Storable]
     private readonly SymbolicExpressionTreeNodeEqualityComparer comparer;
@@ -85,5 +85,5 @@
     }
 
-    public static double MaxCommonSubtreeSimilarity(ISymbolicExpressionTree a, ISymbolicExpressionTree b, ISymbolicExpressionTreeNodeSimilarityComparer comparer) {
+    public static double MaxCommonSubtreeSimilarity(ISymbolicExpressionTree a, ISymbolicExpressionTree b, ISymbolicExpressionTreeNodeEqualityComparer comparer) {
       int max = 0;
       var rootA = a.Root.GetSubtree(0).GetSubtree(0);
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs	(revision 11926)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreeNodeEqualityComparer.cs	(revision 11927)
@@ -28,5 +28,5 @@
   [Item("SymbolicExpressionTreeNodeEqualityComparer", "An operator that checks node equality based on different similarity measures.")]
   [StorableClass]
-  public class SymbolicExpressionTreeNodeEqualityComparer : Item, ISymbolicExpressionTreeNodeSimilarityComparer {
+  public class SymbolicExpressionTreeNodeEqualityComparer : Item, ISymbolicExpressionTreeNodeEqualityComparer {
     [StorableConstructor]
     protected SymbolicExpressionTreeNodeEqualityComparer(bool deserializing) : base(deserializing) { }
Index: /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 11927)
+++ /branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/TreeMatching/SymbolicExpressionTreePhenotypicSimilarityCalculator.cs	(revision 11927)
@@ -0,0 +1,74 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+  [Item("PhenotypicSimilarityCalculator", "An operator that calculates the similarity betweeon two trees based on the correlation of their outputs.")]
+  [StorableClass]
+  public class PhenotypicSimilarityCalculator : SingleObjectiveSolutionSimilarityCalculator, ISymbolicDataAnalysisExpressionSimilarityCalculator {
+    public IDataAnalysisProblemData ProblemData { get; set; }
+    public ISymbolicDataAnalysisExpressionTreeInterpreter Interpreter { get; set; }
+
+    public PhenotypicSimilarityCalculator(PhenotypicSimilarityCalculator original, Cloner cloner)
+      : base(original, cloner) {
+    }
+
+    public PhenotypicSimilarityCalculator() { }
+
+    [StorableConstructor]
+    protected PhenotypicSimilarityCalculator(bool deserializing) : base(deserializing) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new PhenotypicSimilarityCalculator(this, cloner);
+    }
+
+    public double CalculateSimilarity(ISymbolicExpressionTree t1, ISymbolicExpressionTree t2) {
+      var v1 = Interpreter.GetSymbolicExpressionTreeValues(t1, ProblemData.Dataset, ProblemData.TrainingIndices);
+      var v2 = Interpreter.GetSymbolicExpressionTreeValues(t2, ProblemData.Dataset, ProblemData.TrainingIndices);
+
+      OnlineCalculatorError error;
+      var r2 = OnlinePearsonsRSquaredCalculator.Calculate(v1, v2, out error);
+
+      if (r2 > 1.0)
+        r2 = 1.0;
+
+      return error == OnlineCalculatorError.None ? r2 : 0;
+    }
+
+    public override double CalculateSolutionSimilarity(IScope leftSolution, IScope rightSolution) {
+      var leftValues = (DoubleArray)leftSolution.Variables["EstimatedValues"].Value;
+      var rightValues = (DoubleArray)rightSolution.Variables["EstimatedValues"].Value;
+      OnlineCalculatorError error;
+      var r2 = OnlinePearsonsRSquaredCalculator.Calculate(leftValues, rightValues, out error);
+
+      if (r2 > 1.0)
+        r2 = 1.0; // sometimes due to fp errors it can happen that the r2 is over 1 (like 1.0000000009)
+
+      return error == OnlineCalculatorError.None ? r2 : 0;
+    }
+  }
+}
