Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/16/10 10:35:28 (14 years ago)
Author:
svonolfe
Message:

Updated the IntegerVector project to use the new solution encodings (#909)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/Tests/DiscreteCrossoverTest.cs

    r3053 r3059  
    6868    public void DiscreteCrossoverCrossTest() {
    6969      DiscreteCrossover_Accessor target = new DiscreteCrossover_Accessor(new PrivateObject(typeof(DiscreteCrossover)));
    70       ItemArray<IntArray> parents;
     70      ItemArray<IntegerVector> parents;
    7171      TestRandom random = new TestRandom();
    7272      bool exceptionFired;
    7373      // The following test checks if there is an exception when there are less than 2 parents
    7474      random.Reset();
    75       parents = new ItemArray<IntArray>(new IntArray[] { new IntArray(4) });
     75      parents = new ItemArray<IntegerVector>(new IntegerVector[] { new IntegerVector(4) });
    7676      exceptionFired = false;
    7777      try {
     
    9090    public void DiscreteCrossoverApplyTest() {
    9191      TestRandom random = new TestRandom();
    92       IntArray parent1, parent2, expected, actual;
     92      IntegerVector parent1, parent2, expected, actual;
    9393      bool exceptionFired;
    9494      // The following test is not based on published examples
    9595      random.Reset();
    9696      random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 };
    97       parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1 });
    98       parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 });
    99       expected = new IntArray(new int[] { 2, 2, 3, 5, 8 });
     97      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1 });
     98      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
     99      expected = new IntegerVector(new int[] { 2, 2, 3, 5, 8 });
    100100      actual = DiscreteCrossover.Apply(random, parent1, parent2);
    101101      Assert.IsTrue(Auxiliary.IntVectorIsEqualByPosition(actual, expected));
     
    104104      random.Reset();
    105105      random.DoubleNumbers = new double[] { 0, 0, 0.9, 0, 0.9 };
    106       parent1 = new IntArray(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer
    107       parent2 = new IntArray(new int[] { 4, 1, 3, 2, 8 });
     106      parent1 = new IntegerVector(new int[] { 2, 2, 3, 5, 1, 9 }); // this parent is longer
     107      parent2 = new IntegerVector(new int[] { 4, 1, 3, 2, 8 });
    108108      exceptionFired = false;
    109109      try {
Note: See TracChangeset for help on using the changeset viewer.