Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/10 23:49:54 (15 years ago)
Author:
swagner
Message:

Renamed classes of HeuristicLab.Data (#909)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Tests/SinglePointCrossoverTest.cs

    r2936 r3048  
    6868    public void SinglePointCrossoverCrossTest() {
    6969      SinglePointCrossover_Accessor target = new SinglePointCrossover_Accessor(new PrivateObject(typeof(SinglePointCrossover)));
    70       ItemArray<DoubleArrayData> parents;
     70      ItemArray<DoubleArray> parents;
    7171      TestRandom random = new TestRandom();
    7272      bool exceptionFired;
    7373      // The following test checks if there is an exception when there are more than 2 parents
    7474      random.Reset();
    75       parents = new ItemArray<DoubleArrayData>(new DoubleArrayData[] { new DoubleArrayData(5), new DoubleArrayData(6), new DoubleArrayData(4) });
     75      parents = new ItemArray<DoubleArray>(new DoubleArray[] { new DoubleArray(5), new DoubleArray(6), new DoubleArray(4) });
    7676      exceptionFired = false;
    7777      try {
    78         DoubleArrayData actual;
     78        DoubleArray actual;
    7979        actual = target.Cross(random, parents);
    8080      }
     
    8585      // The following test checks if there is an exception when there are less than 2 parents
    8686      random.Reset();
    87       parents = new ItemArray<DoubleArrayData>(new DoubleArrayData[] { new DoubleArrayData(4) });
     87      parents = new ItemArray<DoubleArray>(new DoubleArray[] { new DoubleArray(4) });
    8888      exceptionFired = false;
    8989      try {
    90         DoubleArrayData actual;
     90        DoubleArray actual;
    9191        actual = target.Cross(random, parents);
    9292      } catch (System.ArgumentException) {
     
    102102    public void SinglePointCrossoverApplyTest() {
    103103      TestRandom random = new TestRandom();
    104       DoubleArrayData parent1, parent2, expected, actual;
     104      DoubleArray parent1, parent2, expected, actual;
    105105      bool exceptionFired;
    106106      // The following test is not based on published examples
    107107      random.Reset();
    108108      random.IntNumbers = new int[] { 3 };
    109       parent1 = new DoubleArrayData(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });
    110       parent2 = new DoubleArrayData(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 });
    111       expected = new DoubleArrayData(new double[] { 0.2, 0.2, 0.3, 0.2, 0.8 });
     109      parent1 = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });
     110      parent2 = new DoubleArray(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 });
     111      expected = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.2, 0.8 });
    112112      actual = SinglePointCrossover.Apply(random, parent1, parent2);
    113113      Assert.IsTrue(Auxiliary.RealVectorIsAlmostEqualByPosition(actual, expected));
     
    115115      random.Reset();
    116116      random.IntNumbers = new int[] { 2 };
    117       parent1 = new DoubleArrayData(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1, 0.9 }); // this parent is longer
    118       parent2 = new DoubleArrayData(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 });
     117      parent1 = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1, 0.9 }); // this parent is longer
     118      parent2 = new DoubleArray(new double[] { 0.4, 0.1, 0.3, 0.2, 0.8 });
    119119      exceptionFired = false;
    120120      try {
Note: See TracChangeset for help on using the changeset viewer.