Index: trunk/sources/HeuristicLab.RealVector/AverageCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/AverageCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/AverageCrossover.cs	(revision 73)
@@ -11,9 +11,7 @@
     }
 
-    public static double[] Apply(IScope scope, IRandom random, double[] parent1, double[] parent2) {
+    public static double[] Apply(IRandom random, double[] parent1, double[] parent2) {
       int length = parent1.Length;
       double[] result = new double[length];
-      double min = scope.GetVariableValue<DoubleData>("Minimum", true).Data;
-      double max = scope.GetVariableValue<DoubleData>("Maximum", true).Data;
 
       for (int i = 0; i < length; i++) {
@@ -23,15 +21,10 @@
           result[i] = parent1[i];
         }
-
-        // check borders
-        if (result[i] < min) { result[i] = min; }
-        if (result[i] > max) { result[i] = max; }
       }
-
       return result;
     }
 
     protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) {
-      return Apply(scope, random, parent1, parent2);
+      return Apply(random, parent1, parent2);
     }
   }
Index: trunk/sources/HeuristicLab.RealVector/CompleteAverageCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/CompleteAverageCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/CompleteAverageCrossover.cs	(revision 73)
@@ -11,23 +11,15 @@
     }
 
-    public static double[] Apply(IScope scope, IRandom random, double[] parent1, double[] parent2) {
+    public static double[] Apply(IRandom random, double[] parent1, double[] parent2) {
       int length = parent1.Length;
       double[] result = new double[length];
-      double min = scope.GetVariableValue<DoubleData>("Minimum", true).Data;
-      double max = scope.GetVariableValue<DoubleData>("Maximum", true).Data;
 
-      for (int i = 0; i < length; i++) {
+      for (int i = 0; i < length; i++)
         result[i] = (parent1[i] + parent2[i]) / 2;
-
-        // check borders
-        if (result[i] < min) { result[i] = min; }
-        if (result[i] > max) { result[i] = max; }
-      }
-
       return result;
     }
 
     protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) {
-      return Apply(scope, random, parent1, parent2);
+      return Apply(random, parent1, parent2);
     }
   }
Index: trunk/sources/HeuristicLab.RealVector/DiscreteCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/DiscreteCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/DiscreteCrossover.cs	(revision 73)
@@ -15,11 +15,9 @@
 
       for (int i = 0; i < length; i++) {
-        if (random.NextDouble() < 0.5) {
+        if (random.NextDouble() < 0.5)
           result[i] = parent1[i];
-        } else {
+        else
           result[i] = parent2[i];
-        }
       }
-
       return result;
     }
Index: trunk/sources/HeuristicLab.RealVector/HeuristicCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/HeuristicCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/HeuristicCrossover.cs	(revision 73)
@@ -10,4 +10,5 @@
     public HeuristicCrossover()
       : base() {
+      AddVariableInfo(new VariableInfo("Maximization", "Maximization problem", typeof(BoolData), VariableKind.In));
       AddVariableInfo(new VariableInfo("Quality", "Quality value", typeof(DoubleData), VariableKind.In));
       AddVariableInfo(new VariableInfo("RealVector", "Parent and child real vector", typeof(DoubleArrayData), VariableKind.In | VariableKind.New));
@@ -18,50 +19,30 @@
     }
 
-    public static double[] Apply(IScope scope, IRandom random, double[] parent1, double[] parent2, double quality1, double quality2) {
-      double factor;
+    public static double[] Apply(IRandom random, bool maximization, double[] parent1, double quality1, double[] parent2, double quality2) {
       int length = parent1.Length;
       double[] result = new double[length];
-      bool isMaximization = scope.GetVariableValue<BoolData>("Maximization", true).Data;
-      double min = scope.GetVariableValue<DoubleData>("Minimum", true).Data;
-      double max = scope.GetVariableValue<DoubleData>("Maximum", true).Data;
-
-      factor = random.NextDouble();
+      double factor = random.NextDouble();
 
       for (int i = 0; i < length; i++) {
-        if (isMaximization) {
-          // maximization problem
-          if (quality1 > quality2) {
-            result[i] = parent1[i] + factor * (parent1[i] - parent2[i]);
-          } else {
-            result[i] = parent2[i] + factor * (parent2[i] - parent1[i]);
-          } // if
-        } else {
-          // minimization problem
-          if (quality1 < quality2) {
-            result[i] = parent1[i] + factor * (parent1[i] - parent2[i]);
-          } else {
-            result[i] = parent2[i] + factor * (parent2[i] - parent1[i]);
-          } // if
-        } // if
-
-        // check borders
-        if (result[i] < min) { result[i] = min; }
-        if (result[i] > max) { result[i] = max; }
-      } // for
-
+        if ((maximization && (quality1 > quality2)) || ((!maximization) && (quality1 < quality2)))
+          result[i] = parent1[i] + factor * (parent1[i] - parent2[i]);
+        else
+          result[i] = parent2[i] + factor * (parent2[i] - parent1[i]);
+      }
       return result;
     }
 
     protected sealed override void Cross(IScope scope, IRandom random, IScope parent1, IScope parent2, IScope child) {
+      bool maximization = GetVariableValue<BoolData>("Maximization", scope, true).Data;
       IVariableInfo realVectorInfo = GetVariableInfo("RealVector");
       IVariableInfo qualityInfo = GetVariableInfo("Quality");
       DoubleArrayData vector1 = parent1.GetVariableValue<DoubleArrayData>(realVectorInfo.ActualName, false);
+      DoubleData quality1 = parent1.GetVariableValue<DoubleData>(qualityInfo.ActualName, false);
       DoubleArrayData vector2 = parent2.GetVariableValue<DoubleArrayData>(realVectorInfo.ActualName, false);
-      DoubleData quality1 = parent1.GetVariableValue<DoubleData>(qualityInfo.ActualName, false);
       DoubleData quality2 = parent2.GetVariableValue<DoubleData>(qualityInfo.ActualName, false);
 
       if (vector1.Data.Length != vector2.Data.Length) throw new InvalidOperationException("Cannot apply crossover to real vectors of different length.");
 
-      double[] result = Apply(scope, random, vector1.Data, vector2.Data, quality1.Data, quality2.Data);
+      double[] result = Apply(random, maximization, vector1.Data, quality1.Data, vector2.Data, quality2.Data);
       child.AddVariable(new Variable(realVectorInfo.ActualName, new DoubleArrayData(result)));
     }
Index: trunk/sources/HeuristicLab.RealVector/RandomConvexCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/RandomConvexCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/RandomConvexCrossover.cs	(revision 73)
@@ -11,26 +11,16 @@
     }
 
-    public static double[] Apply(IScope scope, IRandom random, double[] parent1, double[] parent2) {
-      double factor;
+    public static double[] Apply(IRandom random, double[] parent1, double[] parent2) {
       int length = parent1.Length;
       double[] result = new double[length];
-      double min = scope.GetVariableValue<DoubleData>("Minimum", true).Data;
-      double max = scope.GetVariableValue<DoubleData>("Maximum", true).Data;
+      double factor = random.NextDouble();
 
-      factor = random.NextDouble();
-
-      for (int i = 0; i < length; i++) {
+      for (int i = 0; i < length; i++)
         result[i] = (factor * parent1[i]) + ((1 - factor) * parent2[i]);
-
-        // check borders
-        if (result[i] < min) { result[i] = min; }
-        if (result[i] > max) { result[i] = max; }
-      }
-
       return result;
     }
 
     protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) {
-      return Apply(scope, random, parent1, parent2);
+      return Apply(random, parent1, parent2);
     }
   }
Index: trunk/sources/HeuristicLab.RealVector/RandomLocalCrossover.cs
===================================================================
--- trunk/sources/HeuristicLab.RealVector/RandomLocalCrossover.cs	(revision 70)
+++ trunk/sources/HeuristicLab.RealVector/RandomLocalCrossover.cs	(revision 73)
@@ -11,25 +11,18 @@
     }
 
-    public static double[] Apply(IScope scope, IRandom random, double[] parent1, double[] parent2) {
+    public static double[] Apply(IRandom random, double[] parent1, double[] parent2) {
       double factor;
       int length = parent1.Length;
       double[] result = new double[length];
-      double min = scope.GetVariableValue<DoubleData>("Minimum", true).Data;
-      double max = scope.GetVariableValue<DoubleData>("Maximum", true).Data;
 
       for (int i = 0; i < length; i++) {
         factor = random.NextDouble();
         result[i] = (factor * parent1[i]) + ((1 - factor) * parent2[i]);
-
-        // check borders
-        if (result[i] < min) { result[i] = min; }
-        if (result[i] > max) { result[i] = max; }
       }
-
       return result;
     }
 
     protected override double[] Cross(IScope scope, IRandom random, double[] parent1, double[] parent2) {
-      return Apply(scope, random, parent1, parent2);
+      return Apply(random, parent1, parent2);
     }
   }
