Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Creators/RandomBinaryVectorCreator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Creators/RandomBinaryVectorCreator.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Creators/RandomBinaryVectorCreator.cs	(revision 3062)
@@ -0,0 +1,53 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// Generates a new random binary vector with each element randomly initialized.
+  /// </summary>
+  [Item("RandomBinaryVectorCreator", "An operator which creates a new random binary vector with each element randomly initialized.")]
+  [StorableClass]
+  [Creatable("Test")]
+  class RandomBinaryVectorCreator: BinaryVectorCreator {
+    /// <summary>
+    /// Generates a new random binary vector with the given <paramref name="length"/>.
+    /// </summary>
+    /// <param name="random">The random number generator.</param>
+    /// <param name="length">The length of the binary vector.</param>
+    /// <returns>The newly created binary vector.</returns>
+    public static BinaryVector Apply(IRandom random, int length) {
+      BinaryVector result = new BinaryVector(length, random);
+      return result;
+    }
+
+    protected override BinaryVector Create(IRandom random, IntValue length) {
+      return Apply(random, length.Value);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/NPointCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/NPointCrossover.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/NPointCrossover.cs	(revision 3062)
@@ -0,0 +1,135 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// N point crossover for binary vectors.
+  /// </summary>
+  /// <remarks>
+  /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg..
+  /// </remarks>
+  [Item("NPointCrossover", "N point crossover for binary vectors. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
+  [StorableClass]
+  public class NPointCrossover: BinaryVectorCrossover {
+    /// <summary>
+    /// Number of crossover points.
+    /// </summary>
+    public ValueLookupParameter<IntValue> NParameter {
+      get { return (ValueLookupParameter<IntValue>)Parameters["N"]; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="NPointCrossover"/>
+    /// </summary>
+    public NPointCrossover() {
+      Parameters.Add(new ValueLookupParameter<IntValue>("N", "Number of crossover points"));
+    }
+
+    /// <summary>
+    /// Performs a N point crossover at randomly chosen positions of the two 
+    /// given parent binary vectors.
+    /// </summary>
+    /// <exception cref="ArgumentException">Thrown when the value for N is invalid or when the parent vectors are of different length.</exception>
+    /// <param name="random">A random number generator.</param>
+    /// <param name="parent1">The first parent for crossover.</param>
+    /// <param name="parent2">The second parent for crossover.</param>
+    /// <param name="n">Number of crossover points.</param>
+    /// <returns>The newly created binary vector, resulting from the N point crossover.</returns>
+    public static BinaryVector Apply(IRandom random, BinaryVector parent1, BinaryVector parent2, IntValue n) {
+      if (parent1.Length != parent2.Length)
+        throw new ArgumentException("NPointCrossover: The parents are of different length.");
+
+      if (n.Value > parent1.Length)
+        throw new ArgumentException("NPointCrossover: There cannot be more breakpoints than the size of the parents.");
+
+      if (n.Value < 1)
+        throw new ArgumentException("NPointCrossover: N cannot be < 1.");
+
+      int length = parent1.Length;
+      bool[] result = new bool[length];
+      int[] breakpoints = new int[n.Value];
+
+      //choose break points
+      List<int> breakpointPool = new List<int>();
+           
+      for (int i = 0; i < length; i++)
+        breakpointPool.Add(i);
+
+      for (int i = 0; i < n.Value; i++) {
+        int index = random.Next(breakpointPool.Count);
+        breakpoints[i] = breakpointPool[index];
+        breakpointPool.RemoveAt(index);
+      }
+
+      Array.Sort(breakpoints);
+
+      //perform crossover
+      int arrayIndex = 0;
+      int breakPointIndex = 0;
+      bool firstParent = true;
+
+      while (arrayIndex < length) {
+        if (breakPointIndex < breakpoints.Length && 
+          arrayIndex == breakpoints[breakPointIndex]) {
+          breakPointIndex++;
+          firstParent = !firstParent;
+        }
+
+        if (firstParent)
+          result[arrayIndex] = parent1[arrayIndex];
+        else
+          result[arrayIndex] = parent2[arrayIndex];
+
+        arrayIndex++;
+      }
+
+      return new BinaryVector(result);
+    }
+
+    /// <summary>
+    /// Performs a N point crossover at a randomly chosen position of two 
+    /// given parent binary vectors.
+    /// </summary>
+    /// <exception cref="ArgumentException">Thrown if there are not exactly two parents.</exception>
+    /// <exception cref="InvalidOperationException">
+    /// Thrown when the N parameter could not be found.</description></item>
+    /// </exception>
+    /// <param name="random">A random number generator.</param>
+    /// <param name="parents">An array containing the two binary vectors that should be crossed.</param>
+    /// <returns>The newly created binary vector, resulting from the N point crossover.</returns>
+    protected override BinaryVector Cross(IRandom random, ItemArray<BinaryVector> parents) {
+      if (parents.Length != 2) throw new ArgumentException("ERROR in NPointCrossover: The number of parents is not equal to 2");
+
+      if (NParameter.ActualValue == null) throw new InvalidOperationException("NPointCrossover: Parameter " + NParameter.ActualName + " could not be found.");
+
+      return Apply(random, parents[0], parents[1], NParameter.Value);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/SinglePointCrossover.cs	(revision 3062)
@@ -0,0 +1,55 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// Single point crossover for binary vectors.
+  /// </summary>
+  /// <remarks>
+  /// It is implemented based on the NPointCrossover
+  /// </remarks>
+  [Item("SinglePointCrossover", "Single point crossover for binary vectors. It is implemented based on the NPointCrossover.")]
+  [StorableClass]
+  public class SinglePointCrossover: BinaryVectorCrossover {
+    /// <summary>
+    /// Performs a single point crossover at a randomly chosen position of two 
+    /// given parent binary vectors.
+    /// </summary>
+    /// <exception cref="ArgumentException">Thrown if there are not exactly two parents.</exception>
+    /// <param name="random">A random number generator.</param>
+    /// <param name="parents">An array containing the two binary vectors that should be crossed.</param>
+    /// <returns>The newly created binary vector, resulting from the single point crossover.</returns>
+    protected override BinaryVector Cross(IRandom random, ItemArray<BinaryVector> parents) {
+      if (parents.Length != 2) throw new ArgumentException("ERROR in NPointCrossover: The number of parents is not equal to 2");
+
+      return NPointCrossover.Apply(random, parents[0], parents[1], new IntValue(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/UniformCrossover.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/UniformCrossover.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Crossovers/UniformCrossover.cs	(revision 3062)
@@ -0,0 +1,79 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// Uniform crossover for binary vectors.
+  /// </summary>
+  /// <remarks>
+  /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.
+  /// </remarks>
+  [Item("UniformCrossover", "Uniform crossover for binary vectors. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]
+  [StorableClass]
+  public class UniformCrossover: BinaryVectorCrossover {
+    /// <summary>
+    /// Performs a uniform crossover between two binary vectors.
+    /// </summary>
+    /// <param name="random">A random number generator.</param>
+    /// <param name="parent1">The first parent for crossover.</param>
+    /// <param name="parent2">The second parent for crossover.</param>
+    /// <returns>The newly created binary vector, resulting from the uniform crossover.</returns>
+    public static BinaryVector Apply(IRandom random, BinaryVector parent1, BinaryVector parent2) {
+      if (parent1.Length != parent2.Length)
+        throw new ArgumentException("UniformCrossover: The parents are of different length.");
+
+      int length = parent1.Length;
+      bool[] result = new bool[length];
+
+      for (int i = 0; i < length; i++) {
+        if (random.NextDouble() < 0.5)
+          result[i] = parent1[i];
+        else
+          result[i] = parent2[i];
+      }
+      
+      return new BinaryVector(result);
+    }
+
+    /// <summary>
+    /// Performs a uniform crossover at a randomly chosen position of two 
+    /// given parent binary vectors.
+    /// </summary>
+    /// <exception cref="ArgumentException">Thrown if there are not exactly two parents.</exception>
+    /// <param name="random">A random number generator.</param>
+    /// <param name="parents">An array containing the two binary vectors that should be crossed.</param>
+    /// <returns>The newly created binary vector, resulting from the uniform crossover.</returns>
+    protected override BinaryVector Cross(IRandom random, ItemArray<BinaryVector> parents) {
+      if (parents.Length != 2) throw new ArgumentException("ERROR in UniformCrossover: The number of parents is not equal to 2");
+
+      return Apply(random, parents[0], parents[1]);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj	(revision 3061)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.csproj	(revision 3062)
@@ -85,4 +85,8 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Creators\RandomBinaryVectorCreator.cs" />
+    <Compile Include="Crossovers\UniformCrossover.cs" />
+    <Compile Include="Crossovers\SinglePointCrossover.cs" />
+    <Compile Include="Crossovers\NPointCrossover.cs" />
     <Compile Include="HeuristicLabEncodingsBinaryVectorEncodingPlugin.cs" />
     <Compile Include="BinaryVector.cs" />
@@ -94,4 +98,6 @@
     <Compile Include="BinaryVectorCrossover.cs" />
     <Compile Include="BinaryVectorManipulator.cs" />
+    <Compile Include="Manipulators\SomePositionsBitflipManipulator.cs" />
+    <Compile Include="Manipulators\SinglePositionBitflipManipulator.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
@@ -134,9 +140,4 @@
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup>
-    <Folder Include="Creators\" />
-    <Folder Include="Crossovers\" />
-    <Folder Include="Manipulators\" />
-  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SinglePositionBitflipManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SinglePositionBitflipManipulator.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SinglePositionBitflipManipulator.cs	(revision 3062)
@@ -0,0 +1,38 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// Flips exactly one bit of a binary vector.
+  /// </summary>
+  /// <remarks>
+  /// It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.
+  /// </remarks>
+  [Item("SinglePositionBitflipManipulator", "Flips exactly one bit of a binary vector. It is implemented as described in Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg.")]
+  [StorableClass]
+  public class SinglePositionBitflipManipulator: BinaryVectorManipulator {
+    /// <summary>
+    /// Performs the single position bitflip mutation on a binary vector.
+    /// </summary>
+    /// <param name="random">The random number generator to use.</param>
+    /// <param name="vector">The vector that should be manipulated.</param>
+    public static void Apply(IRandom random, BinaryVector vector) {
+      int position = random.Next(vector.Length);
+
+      vector[position] = !vector[position];
+    }
+
+    /// <summary>
+    /// Forwards the call to <see cref="Apply(IRandom, BinaryVector)"/>.
+    /// </summary>
+    /// <param name="random">The random number generator to use.</param>
+    /// <param name="realVector">The vector of binary values to manipulate.</param>
+    protected override void Manipulate(IRandom random, BinaryVector binaryVector) {
+      Apply(random, binaryVector);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SomePositionsBitflipManipulator.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SomePositionsBitflipManipulator.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SomePositionsBitflipManipulator.cs	(revision 3062)
@@ -0,0 +1,57 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding {
+  /// <summary>
+  /// Flips some bits of a binary vector.
+  /// </summary>
+  /// <remarks>
+  /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 43.
+  /// </remarks>
+  [Item("SomePositionsBitflipManipulator", "Flips some bits of a binary vector, each position is flipped with a probability of pm. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 43.")]
+  [StorableClass]
+  public class SomePositionsBitflipManipulator : BinaryVectorManipulator {
+    /// <summary>
+    /// Mmutation probability for each position.
+    /// </summary>
+    public ValueLookupParameter<DoubleValue> MutationProbabilityParameter {
+      get { return (ValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }
+    }
+
+    /// <summary>
+    /// Initializes a new instance of <see cref="NPointCrossover"/>
+    /// </summary>
+    public SomePositionsBitflipManipulator() {
+      Parameters.Add(new ValueLookupParameter<DoubleValue>("MutationProbability", "The mutation probability for each position", new DoubleValue(0.2)));
+    }
+
+    /// <summary>
+    /// Performs the some positions bitflip mutation on a binary vector.
+    /// </summary>
+    /// <param name="random">The random number generator to use.</param>
+    /// <param name="vector">The vector that should be manipulated.</param>
+    /// <param name="pm">The probability a bit is flipped.</param>
+    public static void Apply(IRandom random, BinaryVector vector, DoubleValue pm) {
+      for (int i = 0; i < vector.Length; i++) {
+        if (random.NextDouble() < pm.Value) {
+          vector[i] = !vector[i];
+        }
+      }
+    }
+
+    /// <summary>
+    /// Forwards the call to <see cref="Apply(IRandom, BinaryVector)"/>.
+    /// </summary>
+    /// <param name="random">The random number generator to use.</param>
+    /// <param name="realVector">The vector of binary values to manipulate.</param>
+    protected override void Manipulate(IRandom random, BinaryVector binaryVector) {
+      Apply(random, binaryVector, MutationProbabilityParameter.Value);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.Tests.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.Tests.csproj	(revision 3061)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/HeuristicLab.Encodings.BinaryVectorEncoding-3.3.Tests.csproj	(revision 3062)
@@ -81,5 +81,10 @@
   <ItemGroup>
     <Compile Include="Auxiliary.cs" />
+    <Compile Include="SomePositionsBitflipManipulatorTest.cs" />
+    <Compile Include="SinglePositionBitflipManipulatorTest.cs" />
+    <Compile Include="UniformCrossoverTest.cs" />
+    <Compile Include="SinglePointCrossoverTest.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="NPointCrossoverTest.cs" />
     <Compile Include="TestRandom.cs" />
   </ItemGroup>
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/NPointCrossoverTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/NPointCrossoverTest.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/NPointCrossoverTest.cs	(revision 3062)
@@ -0,0 +1,159 @@
+﻿using HeuristicLab.Encodings.BinaryVectorEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding_33.Tests {
+
+
+  /// <summary>
+  ///This is a test class for SinglePointCrossoverTest and is intended
+  ///to contain all SinglePointCrossoverTest Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class NPointCrossoverTest {
+
+
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    #region Additional test attributes
+    // 
+    //You can use the following additional attributes as you write your tests:
+    //
+    //Use ClassInitialize to run code before running the first test in the class
+    //[ClassInitialize()]
+    //public static void MyClassInitialize(TestContext testContext)
+    //{
+    //}
+    //
+    //Use ClassCleanup to run code after all tests in a class have run
+    //[ClassCleanup()]
+    //public static void MyClassCleanup()
+    //{
+    //}
+    //
+    //Use TestInitialize to run code before running each test
+    //[TestInitialize()]
+    //public void MyTestInitialize()
+    //{
+    //}
+    //
+    //Use TestCleanup to run code after each test has run
+    //[TestCleanup()]
+    //public void MyTestCleanup()
+    //{
+    //}
+    //
+    #endregion
+
+    /// <summary>
+    ///A test for Cross
+    ///</summary>
+    [TestMethod()]
+    [DeploymentItem("HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll")]
+    public void SinglePointCrossoverCrossTest() {
+      NPointCrossover_Accessor target = new NPointCrossover_Accessor(new PrivateObject(typeof(NPointCrossover)));
+      ItemArray<BinaryVector> parents;
+      TestRandom random = new TestRandom();
+      bool exceptionFired;
+      // The following test checks if there is an exception when there are more than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(5), new BinaryVector(6), new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      }
+      catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+      // The following test checks if there is an exception when there are less than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      } catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+    }
+
+    /// <summary>
+    ///A test for Apply
+    ///</summary>
+    [TestMethod()]
+    public void SinglePointCrossoverApplyTest() {
+      TestRandom random = new TestRandom();
+      BinaryVector parent1, parent2, expected, actual;
+      IntValue n;
+      bool exceptionFired;
+      // The following test is based on Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 48
+      random.Reset();
+      n = new IntValue(1);
+      random.IntNumbers = new int[] { 4 };
+      parent1 = new BinaryVector(new bool[] { false, false, false, false, true, false, false, false, false });
+      parent2 = new BinaryVector(new bool[] { true, true, false, true, false, false, false, false, true });
+      expected = new BinaryVector(new bool[] { false, false, false, false, false, false, false, false, true });
+      actual = NPointCrossover.Apply(random, parent1, parent2, n);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(actual, expected));
+      
+      // The following test is based on Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 48
+      random.Reset();
+      n = new IntValue(2);
+      random.IntNumbers = new int[] { 4, 5 };
+      parent1 = new BinaryVector(new bool[] { false, false, false, false, true, false, false, false, false });
+      parent2 = new BinaryVector(new bool[] { true, true, false, true, false, false, false, false, true });
+      expected = new BinaryVector(new bool[] { false, false, false, false, false, false, false, false, false });
+      actual = NPointCrossover.Apply(random, parent1, parent2, n);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(actual, expected));
+
+      // The following test is based on Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 48
+      random.Reset();
+      n = new IntValue(2);
+      random.IntNumbers = new int[] { 4, 5 };
+      parent2 = new BinaryVector(new bool[] { false, false, false, false, true, false, false, false, false });
+      parent1 = new BinaryVector(new bool[] { true, true, false, true, false, false, false, false, true });
+      expected = new BinaryVector(new bool[] { true, true, false, true, true, false, false, false, true });
+      actual = NPointCrossover.Apply(random, parent1, parent2, n);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(actual, expected));
+
+      // The following test is not based on any published examples
+      random.Reset();
+      random.IntNumbers = new int[] { 2 };
+      parent1 = new BinaryVector(new bool[] { false, true, true, false, false }); // this parent is longer
+      parent2 = new BinaryVector(new bool[] { false, true, true, false });
+      exceptionFired = false;
+      try {
+        actual = NPointCrossover.Apply(random, parent1, parent2, n);
+      } catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+    }
+
+    /// <summary>
+    ///A test for SinglePointCrossover Constructor
+    ///</summary>
+    [TestMethod()]
+    public void SinglePointCrossoverConstructorTest() {
+      NPointCrossover target = new NPointCrossover();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs	(revision 3062)
@@ -0,0 +1,106 @@
+﻿using HeuristicLab.Encodings.BinaryVectorEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding_33.Tests {
+
+
+  /// <summary>
+  ///This is a test class for SinglePointCrossoverTest and is intended
+  ///to contain all SinglePointCrossoverTest Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class SinglePointCrossoverTest {
+
+
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    #region Additional test attributes
+    // 
+    //You can use the following additional attributes as you write your tests:
+    //
+    //Use ClassInitialize to run code before running the first test in the class
+    //[ClassInitialize()]
+    //public static void MyClassInitialize(TestContext testContext)
+    //{
+    //}
+    //
+    //Use ClassCleanup to run code after all tests in a class have run
+    //[ClassCleanup()]
+    //public static void MyClassCleanup()
+    //{
+    //}
+    //
+    //Use TestInitialize to run code before running each test
+    //[TestInitialize()]
+    //public void MyTestInitialize()
+    //{
+    //}
+    //
+    //Use TestCleanup to run code after each test has run
+    //[TestCleanup()]
+    //public void MyTestCleanup()
+    //{
+    //}
+    //
+    #endregion
+
+    /// <summary>
+    ///A test for Cross
+    ///</summary>
+    [TestMethod()]
+    [DeploymentItem("HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll")]
+    public void SinglePointCrossoverCrossTest() {
+      SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover)));
+      ItemArray<BinaryVector> parents;
+      TestRandom random = new TestRandom();
+      bool exceptionFired;
+      // The following test checks if there is an exception when there are more than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(5), new BinaryVector(6), new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      }
+      catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+      // The following test checks if there is an exception when there are less than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      } catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+    }
+
+    /// <summary>
+    ///A test for SinglePointCrossover Constructor
+    ///</summary>
+    [TestMethod()]
+    public void SinglePointCrossoverConstructorTest() {
+      SinglePointCrossover target = new SinglePointCrossover();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePositionBitflipManipulatorTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePositionBitflipManipulatorTest.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SinglePositionBitflipManipulatorTest.cs	(revision 3062)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding_33.Tests {
+  /// <summary>
+  ///This is a test class for SinglePositionBitflipManipulator and is intended
+  ///to contain all SinglePositionBitflipManipulator Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class SinglePositionBitflipManipulatorTest {
+
+
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    #region Additional test attributes
+    // 
+    //You can use the following additional attributes as you write your tests:
+    //
+    //Use ClassInitialize to run code before running the first test in the class
+    //[ClassInitialize()]
+    //public static void MyClassInitialize(TestContext testContext)
+    //{
+    //}
+    //
+    //Use ClassCleanup to run code after all tests in a class have run
+    //[ClassCleanup()]
+    //public static void MyClassCleanup()
+    //{
+    //}
+    //
+    //Use TestInitialize to run code before running each test
+    //[TestInitialize()]
+    //public void MyTestInitialize()
+    //{
+    //}
+    //
+    //Use TestCleanup to run code after each test has run
+    //[TestCleanup()]
+    //public void MyTestCleanup()
+    //{
+    //}
+    //
+    #endregion
+
+
+    /// <summary>
+    ///A test for Apply
+    ///</summary>
+    [TestMethod()]
+    public void SinglePositionBitflipManipulatorApplyTest() {
+      TestRandom random = new TestRandom();
+      BinaryVector parent, expected;
+      // The following test is based on Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg, p. 21.
+      random.Reset();
+      random.IntNumbers = new int[] { 4 };
+      parent = new BinaryVector(new bool[] { true, true, true, false, false, false, false, false, false, 
+        false, true, true, true, true, true, true, false, false, false, true, false, true});
+      expected = new BinaryVector(new bool[] { true, true, true, false, true, false, false, false, false, 
+        false, true, true, true, true, true, true, false, false, false, true, false, true});
+      SinglePositionBitflipManipulator.Apply(random, parent);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(expected, parent));
+    }
+
+    /// <summary>
+    ///A test for SinglePositionBitflipManipulator Constructor
+    ///</summary>
+    [TestMethod()]
+    public void SinglePositionBitflipManipulatorConstructorTest() {
+      SinglePositionBitflipManipulator target = new SinglePositionBitflipManipulator();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SomePositionsBitflipManipulatorTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SomePositionsBitflipManipulatorTest.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/SomePositionsBitflipManipulatorTest.cs	(revision 3062)
@@ -0,0 +1,107 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2010 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 Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Encodings.BinaryVectorEncoding;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding_33.Tests {
+  /// <summary>
+  ///This is a test class for SomePositionsBitflipManipulator and is intended
+  ///to contain all SomePositionsBitflipManipulator Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class SomePositionsBitflipManipulatorTest {
+
+
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    #region Additional test attributes
+    // 
+    //You can use the following additional attributes as you write your tests:
+    //
+    //Use ClassInitialize to run code before running the first test in the class
+    //[ClassInitialize()]
+    //public static void MyClassInitialize(TestContext testContext)
+    //{
+    //}
+    //
+    //Use ClassCleanup to run code after all tests in a class have run
+    //[ClassCleanup()]
+    //public static void MyClassCleanup()
+    //{
+    //}
+    //
+    //Use TestInitialize to run code before running each test
+    //[TestInitialize()]
+    //public void MyTestInitialize()
+    //{
+    //}
+    //
+    //Use TestCleanup to run code after each test has run
+    //[TestCleanup()]
+    //public void MyTestCleanup()
+    //{
+    //}
+    //
+    #endregion
+
+
+    /// <summary>
+    ///A test for Apply
+    ///</summary>
+    [TestMethod()]
+    public void SomePositionsBitflipManipulatorApplyTest() {
+      TestRandom random = new TestRandom();
+      BinaryVector parent, expected;
+      DoubleValue pm;
+      // The following test is based on Michalewicz, Z. 1999. Genetic Algorithms + Data Structures = Evolution Programs. Third, Revised and Extended Edition, Spring-Verlag Berlin Heidelberg, p. 21.
+      random.Reset();
+      random.DoubleNumbers = new double[] { 0.3, 0.3, 0.1, 0.1, 0.3, 0.3, 0.3, 0.1, 0.3 };
+      pm = new DoubleValue(0.2);
+      parent = new BinaryVector(new bool[] { true, false, true, false, false, false, false, true, false });
+      expected = new BinaryVector(new bool[] { true, false, false, true, false, false, false, false, false });
+      SomePositionsBitflipManipulator.Apply(random, parent, pm);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(expected, parent));
+    }
+
+    /// <summary>
+    ///A test for SomePositionsBitflipManipulator Constructor
+    ///</summary>
+    [TestMethod()]
+    public void SomePositionsBitflipManipulatorConstructorTest() {
+      SomePositionsBitflipManipulator target = new SomePositionsBitflipManipulator();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/UniformCrossoverTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/UniformCrossoverTest.cs	(revision 3062)
+++ /trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Tests/UniformCrossoverTest.cs	(revision 3062)
@@ -0,0 +1,146 @@
+﻿using HeuristicLab.Encodings.BinaryVectorEncoding;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Parameters;
+
+namespace HeuristicLab.Encodings.BinaryVectorEncoding_33.Tests {
+
+
+  /// <summary>
+  ///This is a test class for SinglePointCrossoverTest and is intended
+  ///to contain all SinglePointCrossoverTest Unit Tests
+  ///</summary>
+  [TestClass()]
+  public class UniformCrossoverTest {
+
+
+    private TestContext testContextInstance;
+
+    /// <summary>
+    ///Gets or sets the test context which provides
+    ///information about and functionality for the current test run.
+    ///</summary>
+    public TestContext TestContext {
+      get {
+        return testContextInstance;
+      }
+      set {
+        testContextInstance = value;
+      }
+    }
+
+    #region Additional test attributes
+    // 
+    //You can use the following additional attributes as you write your tests:
+    //
+    //Use ClassInitialize to run code before running the first test in the class
+    //[ClassInitialize()]
+    //public static void MyClassInitialize(TestContext testContext)
+    //{
+    //}
+    //
+    //Use ClassCleanup to run code after all tests in a class have run
+    //[ClassCleanup()]
+    //public static void MyClassCleanup()
+    //{
+    //}
+    //
+    //Use TestInitialize to run code before running each test
+    //[TestInitialize()]
+    //public void MyTestInitialize()
+    //{
+    //}
+    //
+    //Use TestCleanup to run code after each test has run
+    //[TestCleanup()]
+    //public void MyTestCleanup()
+    //{
+    //}
+    //
+    #endregion
+
+    /// <summary>
+    ///A test for Cross
+    ///</summary>
+    [TestMethod()]
+    [DeploymentItem("HeuristicLab.Encodings.BinaryVectorEncoding-3.3.dll")]
+    public void SinglePointCrossoverCrossTest() {
+      UniformCrossover_Accessor target = new UniformCrossover_Accessor(new PrivateObject(typeof(UniformCrossover)));
+      ItemArray<BinaryVector> parents;
+      TestRandom random = new TestRandom();
+      bool exceptionFired;
+      // The following test checks if there is an exception when there are more than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(5), new BinaryVector(6), new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      }
+      catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+      // The following test checks if there is an exception when there are less than 2 parents
+      random.Reset();
+      parents = new ItemArray<BinaryVector>(new BinaryVector[] { new BinaryVector(4) });
+      exceptionFired = false;
+      try {
+        BinaryVector actual;
+        actual = target.Cross(random, parents);
+      } catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+    }
+
+    /// <summary>
+    ///A test for Apply
+    ///</summary>
+    [TestMethod()]
+    public void SinglePointCrossoverApplyTest() {
+      TestRandom random = new TestRandom();
+      BinaryVector parent1, parent2, expected, actual;
+      bool exceptionFired;
+      // The following test is based on Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 49
+      random.Reset();
+      random.DoubleNumbers = new double[] { 0.35, 0.62, 0.18, 0.42, 0.83, 0.76, 0.39, 0.51, 0.36 };
+      parent1 = new BinaryVector(new bool[] { false, false, false, false, true, false, false, false, false });
+      parent2 = new BinaryVector(new bool[] { true, true, false, true, false, false, false, false, true });
+      expected = new BinaryVector(new bool[] { false, true, false, false, false, false, false, false, false});
+      actual = UniformCrossover.Apply(random, parent1, parent2);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(actual, expected));
+
+      // The following test is based on Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg, p. 49
+      random.Reset();
+      random.DoubleNumbers = new double[] { 0.35, 0.62, 0.18, 0.42, 0.83, 0.76, 0.39, 0.51, 0.36 };
+      parent2 = new BinaryVector(new bool[] { false, false, false, false, true, false, false, false, false });
+      parent1 = new BinaryVector(new bool[] { true, true, false, true, false, false, false, false, true });
+      expected = new BinaryVector(new bool[] { true, false, false, true, true, false, false, false, true });
+      actual = UniformCrossover.Apply(random, parent1, parent2);
+      Assert.IsTrue(Auxiliary.BinaryVectorIsEqualByPosition(actual, expected));
+      
+      // The following test is not based on any published examples
+      random.Reset();
+      random.DoubleNumbers = new double[] { 0.35, 0.62, 0.18, 0.42, 0.83, 0.76, 0.39, 0.51, 0.36 };
+      parent1 = new BinaryVector(new bool[] { false, true, true, false, false }); // this parent is longer
+      parent2 = new BinaryVector(new bool[] { false, true, true, false });
+      exceptionFired = false;
+      try {
+        actual = UniformCrossover.Apply(random, parent1, parent2);
+      } catch (System.ArgumentException) {
+        exceptionFired = true;
+      }
+      Assert.IsTrue(exceptionFired);
+    }
+
+    /// <summary>
+    ///A test for SinglePointCrossover Constructor
+    ///</summary>
+    [TestMethod()]
+    public void SinglePointCrossoverConstructorTest() {
+      NPointCrossover target = new NPointCrossover();
+    }
+  }
+}
