Index: trunk/sources/HeuristicLab.GP/HeuristicLab.GP.csproj
===================================================================
--- trunk/sources/HeuristicLab.GP/HeuristicLab.GP.csproj	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/HeuristicLab.GP.csproj	(revision 1286)
@@ -123,4 +123,8 @@
       <Name>HeuristicLab.Data</Name>
     </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Evolutionary\HeuristicLab.Evolutionary.csproj">
+      <Project>{F5614C53-153C-4A37-A608-121E1C087F07}</Project>
+      <Name>HeuristicLab.Evolutionary</Name>
+    </ProjectReference>
     <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
       <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
Index: trunk/sources/HeuristicLab.GP/Recombination/GPCrossoverBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/GPCrossoverBase.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/GPCrossoverBase.cs	(revision 1286)
@@ -30,10 +30,10 @@
 using HeuristicLab.Constraints;
 using System.Diagnostics;
+using HeuristicLab.Evolutionary;
 
 namespace HeuristicLab.GP {
-  public abstract class GPCrossoverBase : OperatorBase {
+  public abstract class GPCrossoverBase : CrossoverBase {
     public GPCrossoverBase()
       : base() {
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(MersenneTwister), VariableKind.In));
       AddVariableInfo(new VariableInfo("OperatorLibrary", "The operator library containing all available operators", typeof(GPOperatorLibrary), VariableKind.In));
       AddVariableInfo(new VariableInfo("FunctionTree", "The tree to mutate", typeof(IFunctionTree), VariableKind.In | VariableKind.New));
@@ -42,42 +42,28 @@
     }
 
-    public override IOperation Apply(IScope scope) {
-      MersenneTwister random = GetVariableValue<MersenneTwister>("Random", scope, true);
+    internal abstract IFunctionTree Cross(IScope scope, TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1);
+
+    protected override void Cross(IScope scope, IRandom random) {
       GPOperatorLibrary opLibrary = GetVariableValue<GPOperatorLibrary>("OperatorLibrary", scope, true);
       TreeGardener gardener = new TreeGardener(random, opLibrary);
 
-      if ((scope.SubScopes.Count % 2) != 0)
-        throw new InvalidOperationException("Number of parents is not even");
+      if (scope.SubScopes.Count != 2)
+        throw new InvalidOperationException("Number of parents must be exactly two.");
 
-      int children = scope.SubScopes.Count / 2;
-      for (int i = 0; i < children; i++) {
-        IFunctionTree parent0 = TakeNextParent(scope);
-        IFunctionTree parent1 = TakeNextParent(scope);
+      IFunctionTree parent0 = GetVariableValue<IFunctionTree>("FunctionTree", scope.SubScopes[0], false);
+      IFunctionTree parent1 = GetVariableValue<IFunctionTree>("FunctionTree", scope.SubScopes[1], false);
 
-        // randomly swap parents to remove a possible bias from selection (e.g. when using gender-specific selection)
-        if (random.NextDouble() < 0.5) {
-          IFunctionTree tmp = parent0;
-          parent0 = parent1;
-          parent1 = tmp;
-        }
-
-        IFunctionTree child = Cross(scope, gardener, random, parent0, parent1);
-        Debug.Assert(gardener.IsValidTree(child));
-        IScope childScope = new Scope(i.ToString());
-        childScope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FunctionTree"), child));
-        childScope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TreeSize"), new IntData(child.Size)));
-        childScope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TreeHeight"), new IntData(child.Height)));
-        scope.AddSubScope(childScope);
+      // randomly swap parents to remove a possible bias from selection (e.g. when using gender-specific selection)
+      if (random.NextDouble() < 0.5) {
+        IFunctionTree tmp = parent0;
+        parent0 = parent1;
+        parent1 = tmp;
       }
 
-      return null;
-    }
-
-    internal abstract IFunctionTree Cross(IScope scope, TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1);
-
-    private IFunctionTree TakeNextParent(IScope scope) {
-      IFunctionTree parent = GetVariableValue<IFunctionTree>("FunctionTree", scope.SubScopes[0], false);
-      scope.RemoveSubScope(scope.SubScopes[0]);
-      return parent;
+      IFunctionTree child = Cross(scope, gardener, random, parent0, parent1);
+      Debug.Assert(gardener.IsValidTree(child));
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("FunctionTree"), child));
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TreeSize"), new IntData(child.Size)));
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("TreeHeight"), new IntData(child.Height)));
     }
   }
Index: trunk/sources/HeuristicLab.GP/Recombination/OnePointCrossOver.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/OnePointCrossOver.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/OnePointCrossOver.cs	(revision 1286)
@@ -49,5 +49,5 @@
     }
 
-    internal override IFunctionTree Cross(TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
+    internal override IFunctionTree Cross(TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
       List<CrossoverPoint> allowedCrossOverPoints = new List<CrossoverPoint>();
       GetCrossOverPoints(gardener, tree0, tree1, maxTreeSize - tree0.Size, allowedCrossOverPoints);
Index: trunk/sources/HeuristicLab.GP/Recombination/SizeConstrictedGPCrossoverBase.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/SizeConstrictedGPCrossoverBase.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/SizeConstrictedGPCrossoverBase.cs	(revision 1286)
@@ -42,5 +42,5 @@
     }
 
-    internal override IFunctionTree Cross(IScope scope, TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1) {
+    internal override IFunctionTree Cross(IScope scope, TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1) {
       int maxTreeHeight = GetVariableValue<IntData>("MaxTreeHeight", scope, true).Data;
       int maxTreeSize = GetVariableValue<IntData>("MaxTreeSize", scope, true).Data;
@@ -62,11 +62,11 @@
     }
 
-    internal abstract IFunctionTree Cross(TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight);
+    internal abstract IFunctionTree Cross(TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight);
 
-    private IFunctionTree TakeNextParent(IScope scope) {
-      IFunctionTree parent = GetVariableValue<IFunctionTree>("FunctionTree", scope.SubScopes[0], false);
-      scope.RemoveSubScope(scope.SubScopes[0]);
-      return parent;
-    }
+    //private IFunctionTree TakeNextParent(IScope scope) {
+    //  IFunctionTree parent = GetVariableValue<IFunctionTree>("FunctionTree", scope.SubScopes[0], false);
+    //  scope.RemoveSubScope(scope.SubScopes[0]);
+    //  return parent;
+    //}
   }
 }
Index: trunk/sources/HeuristicLab.GP/Recombination/SizeFairCrossOver.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/SizeFairCrossOver.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/SizeFairCrossOver.cs	(revision 1286)
@@ -47,5 +47,5 @@
     }
 
-    internal override IFunctionTree Cross(TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
+    internal override IFunctionTree Cross(TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
       int tries = 0;
       IFunctionTree insertedBranch = null;
@@ -56,5 +56,5 @@
         while (parent == null) parent = gardener.GetRandomParentNode(tree0);
         removedBranchIndex = random.Next(parent.SubTrees.Count);
-        insertedBranch = GetReplacementBranch(random, gardener, tree0, parent, removedBranchIndex, tree1, maxTreeSize, maxTreeHeight);
+        insertedBranch = GetReplacementBranch((MersenneTwister)random, gardener, tree0, parent, removedBranchIndex, tree1, maxTreeSize, maxTreeHeight);
       } while (insertedBranch == null && tries++ < MaxRecombinationTries);
 
Index: trunk/sources/HeuristicLab.GP/Recombination/StandardCrossOver.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/StandardCrossOver.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/StandardCrossOver.cs	(revision 1286)
@@ -44,5 +44,5 @@
     }
 
-    internal override IFunctionTree Cross(TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
+    internal override IFunctionTree Cross(TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
       int tries = 0;
       List<IFunctionTree> allowedCrossoverPoints = null;
Index: trunk/sources/HeuristicLab.GP/Recombination/UniformCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.GP/Recombination/UniformCrossover.cs	(revision 1285)
+++ trunk/sources/HeuristicLab.GP/Recombination/UniformCrossover.cs	(revision 1286)
@@ -52,5 +52,5 @@
     }
 
-    internal override IFunctionTree Cross(TreeGardener gardener, MersenneTwister random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
+    internal override IFunctionTree Cross(TreeGardener gardener, IRandom random, IFunctionTree tree0, IFunctionTree tree1, int maxTreeSize, int maxTreeHeight) {
       List<CrossoverPoint> allowedCrossOverPoints = new List<CrossoverPoint>();
       GetCrossOverPoints(gardener, tree0, tree1, allowedCrossOverPoints);
