Changeset 2867 for trunk/sources/HeuristicLab.Permutation/3.3/Tests/PartiallyMatchedCrossoverTest.cs
- Timestamp:
- 02/25/10 17:22:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Permutation/3.3/Tests/PartiallyMatchedCrossoverTest.cs
r2854 r2867 122 122 Assert.IsTrue(actual.Validate()); 123 123 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 124 124 // The following test is based on an example from Affenzeller, M. et al. 2009. Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications. CRC Press. p. 134. 125 random.Reset(); 126 random.IntNumbers = new int[] { 5, 7 }; 127 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 128 Assert.IsTrue(parent1.Validate()); 129 parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 }); 130 Assert.IsTrue(parent2.Validate()); 131 expected = new Permutation(new int[] { 2, 1, 3, 0, 9, 5, 6, 7, 4, 8 }); 132 Assert.IsTrue(expected.Validate()); 133 actual = PartiallyMatchedCrossover.Apply(random, parent1, parent2); 134 Assert.IsTrue(actual.Validate()); 135 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 136 125 137 // perform a test when the two permutations are of unequal length 126 138 random.Reset();
Note: See TracChangeset
for help on using the changeset viewer.