Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/10 17:53:12 (14 years ago)
Author:
abeham
Message:

Added a permutation type property specifying whether it's a relative (directed or undirected) or absolute permutation #889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Tests/CyclicCrossover2Test.cs

    r3063 r3231  
    7171      try {
    7272        target.Cross(random, new ItemArray<Permutation>(new Permutation[] {
    73           new Permutation(4), new Permutation(4), new Permutation(4)}));
     73          new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)}));
    7474      } catch (System.InvalidOperationException) {
    7575        exceptionFired = true;
     
    8888      random.Reset();
    8989      random.IntNumbers = new int[] { 0 };
    90       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
     90      parent1 = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    9191      Assert.IsTrue(parent1.Validate());
    92       parent2 = new Permutation(new int[] { 2, 5, 6, 0, 7, 1, 3, 8, 4, 9 });
     92      parent2 = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 2, 5, 6, 0, 7, 1, 3, 8, 4, 9 });
    9393      Assert.IsTrue(parent2.Validate());
    94       expected = new Permutation(new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 });
     94      expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 });
    9595      Assert.IsTrue(expected.Validate());
    9696      actual = CyclicCrossover2.Apply(random, parent1, parent2);
     
    102102      bool exceptionFired = false;
    103103      try {
    104         CyclicCrossover.Apply(random, new Permutation(8), new Permutation(6));
     104        CyclicCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6));
    105105      } catch (System.ArgumentException) {
    106106        exceptionFired = true;
Note: See TracChangeset for help on using the changeset viewer.