Changeset 3060 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/PolynomialOnePositionManipulatorTest.cs
- Timestamp:
- 03/16/10 10:46:59 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/PolynomialOnePositionManipulatorTest.cs
r3053 r3060 85 85 public void PolynomialOnePositionManipulatorApplyTest() { 86 86 TestRandom random = new TestRandom(); 87 DoubleArrayparent, expected;87 RealVector parent, expected; 88 88 DoubleValue contiguity, maxManipulation; 89 89 bool exceptionFired; … … 92 92 random.IntNumbers = new int[] { 3 }; 93 93 random.DoubleNumbers = new double[] { 0.2 }; 94 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });95 expected = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.1261980542102, 0.1 });94 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 95 expected = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.1261980542102, 0.1 }); 96 96 contiguity = new DoubleValue(0.2); 97 97 maxManipulation = new DoubleValue(0.7); 98 98 PolynomialOnePositionManipulator.Apply(random, parent, contiguity, maxManipulation); 99 Assert.IsTrue(Auxiliary. RealVectorIsAlmostEqualByPosition(expected, parent));99 Assert.IsTrue(Auxiliary.DoubleArrayIsAlmostEqualByPosition(expected, parent)); 100 100 // The following test is not based on published examples 101 101 exceptionFired = false; … … 103 103 random.IntNumbers = new int[] { 3 }; 104 104 random.DoubleNumbers = new double[] { 0.2 }; 105 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });105 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 106 106 contiguity = new DoubleValue(-1); //Contiguity value < 0 107 107 maxManipulation = new DoubleValue(0.2);
Note: See TracChangeset
for help on using the changeset viewer.