Index: trunk/sources/HeuristicLab.RealVector/DiscreteMultiCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/DiscreteMultiCrossover.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/DiscreteMultiCrossover.cs	(revision 111)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.RealVector {
+  public class DiscreteMultiCrossover : RealVectorMultiCrossoverBase {
+    public override string Description {
+      get {
+        return @"This creates a new offspring by combining the alleles in the parents such that each allele is randomly selected from one parent";
+      }
+    }
+
+    public static double[] Apply(IRandom random, IList<double[]> parents) {
+      int length = parents[0].Length;
+      double[] result = new double[length];
+      try {
+        for (int i = 0; i < length; i++) {
+          result[i] = parents[random.Next(parents.Count)][i];
+        }
+      } catch (IndexOutOfRangeException) {
+        throw new InvalidOperationException("Cannot apply multicrossover to real vectors of different length.");
+      }
+      return result;
+    }
+
+    protected override double[] Cross(IScope scope, IRandom random, IList<double[]> parents) {
+      return Apply(random, parents);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/DiscreteRecombination.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/DiscreteRecombination.cs	(revision 105)
+++ 	(revision )
@@ -1,73 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.RealVector {
-  public class DiscreteRecombination : OperatorBase {
-    public override string Description {
-      get {
-        return @"Discrete/dominant recombination creates a new offspring by combining the alleles in the parents such that each allele is randomly selected from one parent";
-      }
-    }
-
-    public DiscreteRecombination()
-      : base() {
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Rho", "Amount of parents to recombine", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("RealVector", "Parent and child real vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      int rho = GetVariableValue<IntData>("Rho", scope, true).Data;
-      // with just 1 parent no recombination is necessary/possible
-      if (rho == 1) return null;
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-
-      if (scope.SubScopes.Count % rho != 0)
-        throw new InvalidOperationException("Number of parents is not a multiple of rho");
-      int lambda = scope.SubScopes.Count / rho;
-      IList<double[]> parents = new List<double[]>(rho);
-
-      for (int i = 0; i < lambda; i++) {
-        IScope childScope = new Scope(i.ToString());
-        double[] childGene = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("RealVector", false).Data.Clone();
-        parents.Clear();
-        for (int j = 0; j < rho; j++) {
-          IScope parent = scope.SubScopes[0];
-          parents.Add(parent.GetVariableValue<DoubleArrayData>("RealVector", false).Data);
-          scope.RemoveSubScope(parent);
-        }
-        // actual discrete recombination
-        for (int x = 0; x < childGene.Length; x++) {
-          childGene[x] = parents[random.Next(rho)][x];
-        }
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("RealVector"), new DoubleArrayData(childGene)));
-        scope.AddSubScope(childScope);
-      }
-      return null;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.RealVector/HeuristicLab.RealVector.csproj
===================================================================
--- trunk/sources/HeuristicLab.RealVector/HeuristicLab.RealVector.csproj	(revision 105)
+++ trunk/sources/HeuristicLab.RealVector/HeuristicLab.RealVector.csproj	(revision 111)
@@ -47,13 +47,15 @@
     <Compile Include="BoundsChecker.cs" />
     <Compile Include="DiscreteCrossover.cs" />
+    <Compile Include="DiscreteMultiCrossover.cs" />
     <Compile Include="HeuristicCrossover.cs" />
-    <Compile Include="IntermediateRecombination.cs" />
+    <Compile Include="IntermediateMultiCrossover.cs" />
     <Compile Include="MichalewiczNonUniformAllPositionsManipulator.cs" />
     <Compile Include="MichalewiczNonUniformOnePositionManipulator.cs" />
     <Compile Include="RandomConvexCrossover.cs" />
     <Compile Include="LocalCrossover.cs" />
-    <Compile Include="DiscreteRecombination.cs" />
-    <Compile Include="SelfAdaptiveDiscreteRecombination.cs" />
-    <Compile Include="SelfAdaptiveIntermediateRecombination.cs" />
+    <Compile Include="RealVectorMultiCrossoverBase.cs" />
+    <Compile Include="RealVectorSelfAdaptiveMultiCrossoverBase.cs" />
+    <Compile Include="SelfAdaptiveDiscreteMultiCrossover.cs" />
+    <Compile Include="SelfAdaptiveIntermediateMultiCrossover.cs" />
     <Compile Include="SelfAdaptiveNormalAllPositionsManipulator.cs" />
     <Compile Include="UniformAllPositionsManipulator.cs" />
Index: trunk/sources/HeuristicLab.RealVector/IntermediateMultiCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/IntermediateMultiCrossover.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/IntermediateMultiCrossover.cs	(revision 111)
@@ -0,0 +1,52 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.RealVector {
+  public class IntermediateMultiCrossover : RealVectorMultiCrossoverBase {
+    public override string Description {
+      get {
+        return @"This creates a new offspring by computing the centroid of a number of parents";
+      }
+    }
+
+    public static double[] Apply(IList<double[]> parents) {
+      int length = parents[0].Length;
+      double[] result = new double[length];
+      for (int i = 0; i < length; i++) {
+        double sum = 0.0;
+        for (int j = 0; j < parents.Count; j++)
+          sum += parents[j][i];
+        result[i] = sum / parents.Count;
+      }
+      return result;
+    }
+
+    protected override double[] Cross(IScope scope, IRandom random, IList<double[]> parents) {
+      return Apply(parents);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/IntermediateRecombination.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/IntermediateRecombination.cs	(revision 105)
+++ 	(revision )
@@ -1,77 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.RealVector {
-  public class IntermediateRecombination : OperatorBase {
-    public override string Description {
-      get {
-        return @"Intermediate recombination creates a new offspring by computing the centroid of a number of parents";
-      }
-    }
-
-    public IntermediateRecombination()
-      : base() {
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Rho", "Amount of parents to recombine", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("RealVector", "Parent and child real vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      int rho = GetVariableValue<IntData>("Rho", scope, true).Data;
-      // with just 1 parent no recombination is necessary/possible
-      if (rho == 1) return null;
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-
-      if (scope.SubScopes.Count % rho != 0)
-        throw new InvalidOperationException("Number of parents is not a multiple of rho");
-      int lambda = scope.SubScopes.Count / rho;
-      IList<double[]> parents = new List<double[]>(rho);
-
-      for (int i = 0; i < lambda; i++) {
-        IScope childScope = new Scope(i.ToString());
-        double[] childGene = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("RealVector", false).Data.Clone();
-        parents.Clear();
-        for (int j = 0; j < rho; j++) {
-          IScope parent = scope.SubScopes[0];
-          parents.Add(parent.GetVariableValue<DoubleArrayData>("RealVector", false).Data);
-          scope.RemoveSubScope(parent);
-        }
-        // actual intermediate recombination
-        for (int x = 0; x < childGene.Length; x++) {
-          double sum = 0.0;
-          for (int y = 0; y < rho; y++) {
-            sum += parents[y][x];
-          }
-          childGene[x] = sum / rho;
-        }
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("RealVector"), new DoubleArrayData(childGene)));
-        scope.AddSubScope(childScope);
-      }
-      return null;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.RealVector/RealVectorMultiCrossoverBase.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/RealVectorMultiCrossoverBase.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/RealVectorMultiCrossoverBase.cs	(revision 111)
@@ -0,0 +1,48 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Evolutionary;
+
+namespace HeuristicLab.RealVector {
+  public abstract class RealVectorMultiCrossoverBase : MultiCrossoverBase {
+    public RealVectorMultiCrossoverBase()
+      : base() {
+      AddVariableInfo(new VariableInfo("RealVector", "Parent and child real vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
+    }
+
+    protected sealed override void Cross(IScope scope, IRandom random, IScope[] parents, IScope child) {
+      IList<double[]> parentsList = new List<double[]>(parents.Length);
+
+      for (int i = 0; i < parents.Length; i++)
+        parentsList.Add(parents[i].GetVariableValue<DoubleArrayData>("RealVector", false).Data);
+
+      double[] result = Cross(scope, random, parentsList);
+      child.AddVariable(new Variable(child.TranslateName("RealVector"), new DoubleArrayData(result)));
+    }
+
+    protected abstract double[] Cross(IScope scope, IRandom random, IList<double[]> parents);
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/RealVectorSelfAdaptiveMultiCrossoverBase.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/RealVectorSelfAdaptiveMultiCrossoverBase.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/RealVectorSelfAdaptiveMultiCrossoverBase.cs	(revision 111)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Evolutionary;
+
+namespace HeuristicLab.RealVector {
+  public abstract class RealVectorSelfAdaptiveMultiCrossoverBase : MultiCrossoverBase {
+    public RealVectorSelfAdaptiveMultiCrossoverBase()
+      : base() {
+      AddVariableInfo(new VariableInfo("RealVector", "Parent and child real vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
+      AddVariableInfo(new VariableInfo("StrategyVector", "Endogenous strategy parameter vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
+    }
+
+    protected sealed override void Cross(IScope scope, IRandom random, IScope[] parents, IScope child) {
+      IList<double[]> parentsList = new List<double[]>(parents.Length);
+      IList<double[]> strategyParametersList = new List<double[]>(parents.Length);
+
+      for (int i = 0; i < parents.Length; i++) {
+        parentsList.Add(parents[i].GetVariableValue<DoubleArrayData>("RealVector", false).Data);
+        strategyParametersList.Add(parents[i].GetVariableValue<DoubleArrayData>("StrategyVector", false).Data);
+      }
+
+      double[] childIndividual, strategyParameters;
+      Cross(scope, random, parentsList, strategyParametersList, out childIndividual, out strategyParameters);
+      child.AddVariable(new Variable(child.TranslateName("RealVector"), new DoubleArrayData(childIndividual)));
+      child.AddVariable(new Variable(child.TranslateName("StrategyVector"), new DoubleArrayData(strategyParameters)));
+    }
+
+    protected abstract void Cross(IScope scope, IRandom random, IList<double[]> parents, IList<double[]> strategyParametersList, out double[] childIndividual, out double[] strategyParameters);
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/SelfAdaptiveDiscreteMultiCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/SelfAdaptiveDiscreteMultiCrossover.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/SelfAdaptiveDiscreteMultiCrossover.cs	(revision 111)
@@ -0,0 +1,54 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.RealVector {
+  public class SelfAdaptiveDiscreteMultiCrossover : RealVectorSelfAdaptiveMultiCrossoverBase {
+    public override string Description {
+      get {
+        return @"This creates a new offspring by combining the alleles in the parents such that each allele is randomly selected from one parent. It will also use the same strategy to combine the endogenous strategy parameter vector.";
+      }
+    }
+
+    public static void Apply(IRandom random, IList<double[]> parents, IList<double[]> strategyParametersList, out double[] childIndividual, out double[] strategyParameters) {
+      childIndividual = new double[parents[0].Length];
+      strategyParameters = new double[strategyParametersList[0].Length];
+      try {
+        for (int i = 0; i < childIndividual.Length; i++) {
+          int nextParent = random.Next(parents.Count);
+          childIndividual[i] = parents[nextParent][i];
+          strategyParameters[i] = strategyParametersList[nextParent][i];
+        }
+      } catch (IndexOutOfRangeException) {
+        throw new InvalidOperationException("Cannot apply self adaptive multicrossover to real vectors of different length.");
+      }
+    }
+
+    protected override void Cross(IScope scope, IRandom random, IList<double[]> parents, IList<double[]> strategyParametersList, out double[] childIndividual, out double[] strategyParameters) {
+      Apply(random, parents, strategyParametersList, out childIndividual, out strategyParameters);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/SelfAdaptiveDiscreteRecombination.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/SelfAdaptiveDiscreteRecombination.cs	(revision 105)
+++ 	(revision )
@@ -1,80 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.RealVector {
-  public class SelfAdaptiveDiscreteRecombination : DiscreteRecombination {
-    public override string Description {
-      get {
-        return @"Self adaptive Discrete/dominant recombination creates a new offspring by combining the alleles in the parents such that each allele is randomly selected from one parent. It will also use the same strategy to combine the endogenous strategy parameter vector.";
-      }
-    }
-
-    public SelfAdaptiveDiscreteRecombination()
-      : base() {
-      AddVariableInfo(new VariableInfo("StrategyVector", "Vector containing the endogenous strategy parameters", typeof(DoubleArrayData), VariableKind.In));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      int rho = GetVariableValue<IntData>("Rho", scope, true).Data;
-      // with just 1 parent no recombination is necessary/possible
-      if (rho == 1) return null;
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-
-      if (scope.SubScopes.Count % rho != 0)
-        throw new InvalidOperationException("Number of parents is not a multiple of rho");
-      int lambda = scope.SubScopes.Count / rho;
-      IList<double[]> parents = new List<double[]>(rho);
-      IList<double[]> parentsStrategy = new List<double[]>(rho);
-
-      for (int i = 0; i < lambda; i++) {
-        IScope childScope = new Scope(i.ToString());
-        double[] childGene = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("RealVector", false).Data.Clone();
-        double[] strategyParams = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("StrategyVector", false).Data.Clone();
-        parents.Clear();
-        for (int j = 0; j < rho; j++) {
-          IScope parent = scope.SubScopes[0];
-          parents.Add(parent.GetVariableValue<DoubleArrayData>("RealVector", false).Data);
-          parentsStrategy.Add(parent.GetVariableValue<DoubleArrayData>("StrategyVector", false).Data);
-          scope.RemoveSubScope(parent);
-        }
-        // actual discrete recombination
-        if (childGene.Length != strategyParams.Length)
-          throw new InvalidOperationException("ERROR: strategy vector must be as long as there are dimensions");
-
-        for (int x = 0; x < childGene.Length; x++) {
-          int nextParent = random.Next(rho);
-          childGene[x] = parents[nextParent][x];
-          strategyParams[x] = parentsStrategy[nextParent][x];
-        }
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("RealVector"), new DoubleArrayData(childGene)));
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("StrategyVector"), new DoubleArrayData(strategyParams)));
-        scope.AddSubScope(childScope);
-      }
-      return null;
-    }
-  }
-}
Index: trunk/sources/HeuristicLab.RealVector/SelfAdaptiveIntermediateMultiCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/SelfAdaptiveIntermediateMultiCrossover.cs	(revision 111)
+++ trunk/sources/HeuristicLab.RealVector/SelfAdaptiveIntermediateMultiCrossover.cs	(revision 111)
@@ -0,0 +1,45 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 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.Collections.Generic;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.RealVector {
+  public class SelfAdaptiveIntermediateMultiCrossover : RealVectorSelfAdaptiveMultiCrossoverBase {
+    public override string Description {
+      get {
+        return @"This creates a new offspring by computing the centroid of the parents. It will also use the same strategy to combine the endogenous strategy parameter vector.";
+      }
+    }
+
+    public static void Apply(IList<double[]> parents, IList<double[]> strategyParametersList, out double[] childIndividual, out double[] strategyParameters) {
+      childIndividual = IntermediateMultiCrossover.Apply(parents);
+      strategyParameters = IntermediateMultiCrossover.Apply(strategyParametersList);
+    }
+
+    protected override void Cross(IScope scope, IRandom random, IList<double[]> parents, IList<double[]> strategyParametersList, out double[] childIndividual, out double[] strategyParameters) {
+      Apply(parents, strategyParametersList, out childIndividual, out strategyParameters);
+    }
+  }
+}
Index: trunk/sources/HeuristicLab.RealVector/SelfAdaptiveIntermediateRecombination.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/SelfAdaptiveIntermediateRecombination.cs	(revision 105)
+++ 	(revision )
@@ -1,84 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 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.Collections.Generic;
-using System.Text;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-
-namespace HeuristicLab.RealVector {
-  public class SelfAdaptiveIntermediateRecombination : DiscreteRecombination {
-    public override string Description {
-      get {
-        return @"Self adaptive intermediate recombination creates a new offspring by computing the centroid of the parents. It will also use the same strategy to combine the endogenous strategy parameter vector.";
-      }
-    }
-
-    public SelfAdaptiveIntermediateRecombination()
-      : base() {
-      AddVariableInfo(new VariableInfo("StrategyVector", "Vector containing the endogenous strategy parameters", typeof(DoubleArrayData), VariableKind.In));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      int rho = GetVariableValue<IntData>("Rho", scope, true).Data;
-      // with just 1 parent no recombination is necessary/possible
-      if (rho == 1) return null;
-      IRandom random = GetVariableValue<IRandom>("Random", scope, true);
-
-      if (scope.SubScopes.Count % rho != 0)
-        throw new InvalidOperationException("Number of parents is not a multiple of rho");
-      int lambda = scope.SubScopes.Count / rho;
-      IList<double[]> parents = new List<double[]>(rho);
-      IList<double[]> parentsStrategy = new List<double[]>(rho);
-
-      for (int i = 0; i < lambda; i++) {
-        IScope childScope = new Scope(i.ToString());
-        double[] childGene = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("RealVector", false).Data.Clone();
-        double[] strategyParams = (double[])scope.SubScopes[0].GetVariableValue<DoubleArrayData>("StrategyVector", false).Data.Clone();
-        parents.Clear();
-        for (int j = 0; j < rho; j++) {
-          IScope parent = scope.SubScopes[0];
-          parents.Add(parent.GetVariableValue<DoubleArrayData>("RealVector", false).Data);
-          parentsStrategy.Add(parent.GetVariableValue<DoubleArrayData>("StrategyVector", false).Data);
-          scope.RemoveSubScope(parent);
-        }
-        // actual discrete recombination
-        if (childGene.Length != strategyParams.Length)
-          throw new InvalidOperationException("ERROR: strategy vector must be as long as there are dimensions");
-
-        for (int x = 0; x < childGene.Length; x++) {
-          double sum = 0.0, sumStrategy = 0.0;
-          for (int y = 0; y < rho; y++) {
-            sum += parents[y][x];
-            sumStrategy += parentsStrategy[y][x];
-          }
-          childGene[x] = sum / rho;
-          strategyParams[x] = sumStrategy / rho;
-        }
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("RealVector"), new DoubleArrayData(childGene)));
-        childScope.AddVariable(new Variable(scope.SubScopes[0].TranslateName("StrategyVector"), new DoubleArrayData(strategyParams)));
-        scope.AddSubScope(childScope);
-      }
-      return null;
-    }
-  }
-}
