Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/TracingSymbolicExpressionTreeCrossover.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/TracingSymbolicExpressionTreeCrossover.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/TracingSymbolicExpressionTreeCrossover.cs	(revision 7514)
@@ -27,9 +27,6 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 
-using TreeCacheType = HeuristicLab.Core.ItemList<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>;
-using CloneMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree,
-                                                      HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>;
-using TraceMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree,
-                                                      HeuristicLab.Core.IItemArray<HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.ISymbolicExpressionTree>>;
+using CloneMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Core.IItem, HeuristicLab.Core.IItem>;
+using TraceMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Core.IItem, HeuristicLab.Core.IItemList<HeuristicLab.Core.IItem>>;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -80,6 +77,6 @@
       Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));
       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));
-      Parameters.Add(new LookupParameter<ItemDictionary<ISymbolicExpressionTree, ISymbolicExpressionTree>>(GlobalCloneMapParameterName, "A global map keeping track of trees and their clones (made during selection)."));
-      Parameters.Add(new LookupParameter<ItemDictionary<ISymbolicExpressionTree, IItemArray<ISymbolicExpressionTree>>>(GlobalTraceMapParameterName, "A global cache containing tracing info."));
+      Parameters.Add(new LookupParameter<CloneMapType>(GlobalCloneMapParameterName, "A global map keeping track of trees and their clones (made during selection)."));
+      Parameters.Add(new LookupParameter<TraceMapType>(GlobalTraceMapParameterName, "A global cache containing tracing info."));
     }
 
@@ -91,14 +88,8 @@
         var gScope = ExecutionContext.Scope;
         while (gScope.Parent != null) gScope = gScope.Parent;
-        gScope.Variables.Add(new Variable(GlobalTraceMapParameterName, new ItemDictionary<ISymbolicExpressionTree, IItemArray<ISymbolicExpressionTree>>()));
+        gScope.Variables.Add(new Variable(GlobalTraceMapParameterName, new TraceMapType()));
       }
-      var originalParents = new ItemArray<ISymbolicExpressionTree>(Parents.Select(x => GlobalCloneMap[x]));
-      // prevent incestuous crossover (an individual mating with itself)
-      if (originalParents[0] == originalParents[1]) {
-        Child = Parents[0];
-        return base.Apply();
-      }
+      var originalParents = new ItemList<IItem>(Parents.Select(x => GlobalCloneMap[x]));
       ISymbolicExpressionTree result = Cross(Random, Parents[0], Parents[1]);
-
       Child = result;
       GlobalTraceMap.Add(Child, originalParents);
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj.user	(revision 7514)
@@ -17,3 +17,6 @@
     <StartProgram>C:\Users\bburlacu\Desktop\HL-Core\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
   </PropertyGroup>
+  <PropertyGroup>
+    <ProjectView>ProjectFiles</ProjectView>
+  </PropertyGroup>
 </Project>
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ChangeNodeTypeManipulation.cs	(revision 7514)
@@ -28,5 +28,5 @@
   [StorableClass]
   [Item("ChangeNodeTypeManipulation", "Selects a random tree node and changes the symbol.")]
-  public sealed class ChangeNodeTypeManipulation : SymbolicExpressionTreeManipulator {
+  public sealed class ChangeNodeTypeManipulation : TracingSymbolicExpressionTreeManipulator {
     [StorableConstructor]
     private ChangeNodeTypeManipulation(bool deserializing) : base(deserializing) { }
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs	(revision 7514)
@@ -31,5 +31,5 @@
   [StorableClass]
   [Item("OnePointShaker", "Selects a random node with local parameters and manipulates the selected node.")]
-  public sealed class OnePointShaker : SymbolicExpressionTreeManipulator {
+  public sealed class OnePointShaker : TracingSymbolicExpressionTreeManipulator {
     private const string ShakingFactorParameterName = "ShakingFactor";
     #region parameter properties
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/ReplaceBranchManipulation.cs	(revision 7514)
@@ -30,5 +30,5 @@
   [StorableClass]
   [Item("ReplaceBranchManipulation", "Selects a branch of the tree randomly and replaces it with a newly initialized branch (using PTC2).")]
-  public sealed class ReplaceBranchManipulation : SymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
+  public sealed class ReplaceBranchManipulation : TracingSymbolicExpressionTreeManipulator, ISymbolicExpressionTreeSizeConstraintOperator {
     private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
     private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/TracingSymbolicExpressionTreeManipulator.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/TracingSymbolicExpressionTreeManipulator.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/TracingSymbolicExpressionTreeManipulator.cs	(revision 7514)
@@ -20,9 +20,12 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
-using HeuristicLab.Data;
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+using CloneMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Core.IItem, HeuristicLab.Core.IItem>;
+using TraceMapType = HeuristicLab.Core.ItemDictionary<HeuristicLab.Core.IItem, HeuristicLab.Core.IItemList<HeuristicLab.Core.IItem>>;
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
@@ -34,6 +37,6 @@
   public abstract class TracingSymbolicExpressionTreeManipulator : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeManipulator {
     private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
-    private const string GlobalTraceCacheParameterName = "GlobalTraceCache";
-    private const string GlobalTreeMapParameterName = "GlobalTreeMap";
+    private const string GlobalTraceMapParameterName = "GlobalTraceMap";
+    private const string GlobalCloneMapParameterName = "GlobalCloneMap";
 
     #region Parameter Properties
@@ -41,8 +44,9 @@
       get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
     }
-    public LookupParameter<ItemDictionary<ISymbolicExpressionTree, ISymbolicExpressionTree>> GlobalTreeMapParameter {
-      get {
-        return (LookupParameter<ItemDictionary<ISymbolicExpressionTree, ISymbolicExpressionTree>>)Parameters[GlobalTreeMapParameterName];
-      }
+    public LookupParameter<CloneMapType> GlobalCloneMapParameter {
+      get { return (LookupParameter<CloneMapType>)Parameters[GlobalCloneMapParameterName]; }
+    }
+    public LookupParameter<TraceMapType> GlobalTraceMapParameter {
+      get { return (LookupParameter<TraceMapType>)Parameters[GlobalTraceMapParameterName]; }
     }
     #endregion
@@ -52,6 +56,9 @@
       get { return SymbolicExpressionTreeParameter.ActualValue; }
     }
-    public ItemDictionary<ISymbolicExpressionTree, ISymbolicExpressionTree> GlobalTreeMap {
-      get { return GlobalTreeMapParameter.ActualValue; }
+    public CloneMapType GlobalCloneMap {
+      get { return GlobalCloneMapParameter.ActualValue; }
+    }
+    public TraceMapType GlobalTraceMap {
+      get { return GlobalTraceMapParameter.ActualValue; }
     }
     #endregion
@@ -63,5 +70,6 @@
       : base() {
       Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
-      Parameters.Add(new LookupParameter<ItemDictionary<ISymbolicExpressionTree, ISymbolicExpressionTree>>(GlobalTreeMapParameterName, "A global map keeping track of trees and their clones (made during selection)."));
+      Parameters.Add(new LookupParameter<CloneMapType>(GlobalCloneMapParameterName, "A global map keeping track of trees and their clones (made during selection)."));
+      Parameters.Add(new LookupParameter<TraceMapType>(GlobalTraceMapParameterName, "A global cache containing tracing info."));
     }
 
@@ -69,25 +77,23 @@
       ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue;
 
+      if (GlobalTraceMap == null) {
+        var gScope = ExecutionContext.Scope;
+        while (gScope.Parent != null) gScope = gScope.Parent;
+        gScope.Variables.Add(new Variable(GlobalTraceMapParameterName, new TraceMapType()));
+      }
+      if (GlobalTraceMap.ContainsKey(tree)) {
+        // tree was affected by crossover before mutation
+        // if the tree to be manipulated is already a product of crossover (in the current reproduction phase), then there exists no relationship with the original "parent". 
+        // In order to preserve information, a tree clone is created before mutation and added to the trace map.
+        var clone = (IItem)tree.Clone();
+        GlobalTraceMap[clone] = GlobalTraceMap[tree];
+        GlobalTraceMap[tree] = new ItemList<IItem> { clone };
+      } else {
+        var original = GlobalCloneMap[tree];
+        GlobalTraceMap[tree] = new ItemList<IItem> { original };
+      }
       Manipulate(RandomParameter.ActualValue, tree);
 
-      //AddTraceInfoToGlobalCache();
-
       return base.Apply();
-    }
-
-    private void AddTraceInfoToGlobalCache() {
-      var globalScope = ExecutionContext.Scope;
-      while (globalScope.Parent != null) globalScope = globalScope.Parent;
-
-      Variable globalTraceCache;
-      if (!globalScope.Variables.ContainsKey(GlobalTraceCacheParameterName)) {
-        globalTraceCache = new Variable(GlobalTraceCacheParameterName, new ItemDictionary<ISymbolicExpressionTree, IItemArray<ISymbolicExpressionTree>>());
-        globalScope.Variables.Add(globalTraceCache);
-      } else
-        globalTraceCache = (Variable)globalScope.Variables[GlobalTraceCacheParameterName];
-
-      var traceCache = (ItemDictionary<ISymbolicExpressionTree, IItemArray<ISymbolicExpressionTree>>)globalTraceCache.Value;
-
-      traceCache.Add(SymbolicExpressionTree, new ItemArray<ISymbolicExpressionTree>(new[] { GlobalTreeMap[SymbolicExpressionTree] }));
     }
 
Index: /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs
===================================================================
--- /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs	(revision 7513)
+++ /branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Plugin.cs	(revision 7514)
@@ -26,5 +26,5 @@
 
 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
-  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7439")]
+  [Plugin("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding","Provides operators and related classes for the symbolic expression tree encoding.", "3.4.2.7479")]
   [PluginFile("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll", PluginFileType.Assembly)]
   [PluginDependency("HeuristicLab.Analysis", "3.3")]
