Changeset 2930 for trunk/sources/HeuristicLab.Encodings.Permutation/3.3/Tests/MaximalPreservativeCrossoverTest.cs
- Timestamp:
- 03/04/10 15:15:44 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.Permutation/3.3/Tests/MaximalPreservativeCrossoverTest.cs
r2929 r2930 22 22 using HeuristicLab.Core; 23 23 using Microsoft.VisualStudio.TestTools.UnitTesting; 24 using HeuristicLab.Encodings.Permutation; 24 25 25 26 namespace HeuristicLab.Encodings.Permutation_33.Tests { … … 91 92 bool exceptionFired = false; 92 93 try { 93 target.Cross(random, new ItemArray<Permutation >(newPermutation[] {94 new Permutation (4), new Permutation(4), newPermutation(4)}));94 target.Cross(random, new ItemArray<Permutation.Permutation>(new Permutation.Permutation[] { 95 new Permutation.Permutation(4), new Permutation.Permutation(4), new Permutation.Permutation(4)})); 95 96 } 96 97 catch (System.InvalidOperationException) { … … 106 107 public void MaximalPreservativeCrossoverApplyTest() { 107 108 TestRandom random = new TestRandom(); 108 Permutation parent1, parent2, expected, actual;109 Permutation.Permutation parent1, parent2, expected, actual; 109 110 // The following test is based on an example from Larranaga, 1999. Genetic Algorithms for the Traveling Salesman Problem. 110 111 random.Reset(); 111 112 random.IntNumbers = new int[] { 3, 2 }; 112 parent1 = new Permutation (new int[] { 0, 1, 2, 3, 4, 5, 6, 7 });113 parent1 = new Permutation.Permutation(new int[] { 0, 1, 2, 3, 4, 5, 6, 7 }); 113 114 Assert.IsTrue(parent1.Validate()); 114 parent2 = new Permutation (new int[] { 1, 3, 5, 7, 6, 4, 2, 0 });115 parent2 = new Permutation.Permutation(new int[] { 1, 3, 5, 7, 6, 4, 2, 0 }); 115 116 Assert.IsTrue(parent2.Validate()); 116 expected = new Permutation (new int[] { 1, 0, 2, 3, 4, 5, 7, 6 });117 expected = new Permutation.Permutation(new int[] { 1, 0, 2, 3, 4, 5, 7, 6 }); 117 118 Assert.IsTrue(expected.Validate()); 118 119 actual = MaximalPreservativeCrossover.Apply(random, parent1, parent2); … … 124 125 bool exceptionFired = false; 125 126 try { 126 MaximalPreservativeCrossover.Apply(random, new Permutation (8), newPermutation(6));127 MaximalPreservativeCrossover.Apply(random, new Permutation.Permutation(8), new Permutation.Permutation(6)); 127 128 } 128 129 catch (System.ArgumentException) { … … 131 132 Assert.IsTrue(exceptionFired); 132 133 } 133 134 /// <summary>135 ///A test for OrderCrossover Constructor136 ///</summary>137 [TestMethod()]138 public void MaximalPreservativeCrossoverConstructorTest() {139 MaximalPreservativeCrossover target = new MaximalPreservativeCrossover();140 }141 134 } 142 135 }
Note: See TracChangeset
for help on using the changeset viewer.