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/MaximalPreservativeCrossoverTest.cs

    r3063 r3231  
    9393      try {
    9494        target.Cross(random, new ItemArray<Permutation>(new Permutation[] {
    95           new Permutation(4), new Permutation(4), new Permutation(4)}));
     95          new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4), new Permutation(PermutationTypes.RelativeUndirected, 4)}));
    9696      }
    9797      catch (System.InvalidOperationException) {
     
    111111      random.Reset();
    112112      random.IntNumbers = new int[] { 3, 2 };
    113       parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
     113      parent1 = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });
    114114      Assert.IsTrue(parent1.Validate());
    115       parent2 = new Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });
     115      parent2 = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });
    116116      Assert.IsTrue(parent2.Validate());
    117       expected = new Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });
     117      expected = new Permutation(PermutationTypes.RelativeUndirected, new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });
    118118      Assert.IsTrue(expected.Validate());
    119119      actual = MaximalPreservativeCrossover.Apply(random, parent1, parent2);
     
    125125      bool exceptionFired = false;
    126126      try {
    127         MaximalPreservativeCrossover.Apply(random, new Permutation(8), new Permutation(6));
     127        MaximalPreservativeCrossover.Apply(random, new Permutation(PermutationTypes.RelativeUndirected, 8), new Permutation(PermutationTypes.RelativeUndirected, 6));
    128128      }
    129129      catch (System.ArgumentException) {
Note: See TracChangeset for help on using the changeset viewer.