Changeset 2867
- Timestamp:
- 02/25/10 17:22:13 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Permutation/3.3/Tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Permutation/3.3/Tests/CyclicCrossoverTest.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. pp. 134. 125 random.Reset(); 126 random.DoubleNumbers = new double[] { 0.9 }; 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, 7, 1, 3, 8, 4, 9 }); 130 Assert.IsTrue(parent2.Validate()); 131 expected = new Permutation(new int[] { 0, 5, 2, 3, 7, 1, 6, 8, 4, 9 }); 132 Assert.IsTrue(expected.Validate()); 133 actual = CyclicCrossover.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(); -
trunk/sources/HeuristicLab.Permutation/3.3/Tests/MaximalPreservativeCrossoverTest.cs
r2854 r2867 86 86 [TestMethod()] 87 87 [DeploymentItem("HeuristicLab.Permutation-3.3.dll")] 88 public void CyclicCrossoverCrossTest() {88 public void MaximalPreservativeCrossoverCrossTest() { 89 89 TestRandom random = new TestRandom(); 90 90 MaximalPreservativeCrossover_Accessor target = -
trunk/sources/HeuristicLab.Permutation/3.3/Tests/OrderCrossoverTest.cs
r2854 r2867 173 173 Assert.IsTrue(actual.Validate()); 174 174 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 175 // 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. 135. 176 random.Reset(); 177 random.IntNumbers = new int[] { 2, 5 }; 178 parent1 = new Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); 179 Assert.IsTrue(parent1.Validate()); 180 parent2 = new Permutation(new int[] { 2, 5, 6, 0, 9, 1, 3, 8, 4, 7 }); 181 Assert.IsTrue(parent2.Validate()); 182 expected = new Permutation(new int[] { 2, 0, 9, 1, 3, 5, 6, 7, 8, 4 }); 183 Assert.IsTrue(expected.Validate()); 184 actual = OrderCrossover.Apply(random, parent1, parent2); 185 Assert.IsTrue(actual.Validate()); 186 Assert.IsTrue(Auxiliary.PermutationIsEqualByPosition(expected, actual)); 187 175 188 // perform a test when the two permutations are of unequal length 176 189 random.Reset(); -
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.