- Timestamp:
- 05/06/10 16:41:51 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/SinglePointCrossoverTest.cs
r3376 r3675 95 95 } 96 96 Assert.IsTrue(exceptionFired); 97 // The following test checks if there is an exception when the vector has just one dimension 98 random.Reset(); 99 parents = new ItemArray<RealVector>(new RealVector[] { new RealVector(1) }); 100 exceptionFired = false; 101 try { 102 RealVector actual; 103 actual = target.Cross(random, parents); 104 } catch (System.ArgumentException) { 105 exceptionFired = true; 106 } 107 Assert.IsTrue(exceptionFired); 97 108 } 98 109 … … 125 136 } 126 137 Assert.IsTrue(exceptionFired); 138 // The following test is not based on published examples 139 random.Reset(); 140 random.IntNumbers = new int[] { 5 }; // should not have an effect 141 parent1 = new RealVector(new double[] { 0.2, 0.4 }); 142 parent2 = new RealVector(new double[] { 0.6, 0.1 }); 143 expected = new RealVector(new double[] { 0.2, 0.1 }); 144 actual = SinglePointCrossover.Apply(random, parent1, parent2); 145 Assert.IsTrue(Auxiliary.RealVectorIsAlmostEqualByPosition(actual, expected)); 146 // The following test is not based on published examples 127 147 } 128 148
Note: See TracChangeset
for help on using the changeset viewer.