Changeset 3060 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/PolynomialAllPositionManipulatorTest.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/PolynomialAllPositionManipulatorTest.cs
r3053 r3060 85 85 public void PolynomialAllPositionManipulatorApplyTest() { 86 86 TestRandom random = new TestRandom(); 87 DoubleArrayparent, expected;87 RealVector parent, expected; 88 88 DoubleValue contiguity, maxManipulation; 89 89 bool exceptionFired; … … 91 91 random.Reset(); 92 92 random.DoubleNumbers = new double[] { 0.2, 0.7, 0.8, 0.01, 0.1 }; 93 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });94 expected = new DoubleArray(new double[] { 0.120213215256006, 0.336631954950876, 0.474551336679454, 0.322759240811056, -0.0182075293954083 });93 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 94 expected = new RealVector(new double[] { 0.120213215256006, 0.336631954950876, 0.474551336679454, 0.322759240811056, -0.0182075293954083 }); 95 95 contiguity = new DoubleValue(0.8); 96 96 maxManipulation = new DoubleValue(0.2); 97 97 PolynomialAllPositionManipulator.Apply(random, parent, contiguity, maxManipulation); 98 Assert.IsTrue(Auxiliary. RealVectorIsAlmostEqualByPosition(expected, parent));98 Assert.IsTrue(Auxiliary.DoubleArrayIsAlmostEqualByPosition(expected, parent)); 99 99 // The following test is not based on published examples 100 100 exceptionFired = false; 101 101 random.Reset(); 102 102 random.DoubleNumbers = new double[] { 0.2, 0.7, 0.8, 0.01, 0.1 }; 103 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });103 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 104 104 contiguity = new DoubleValue(-1); //Contiguity value < 0 105 105 maxManipulation = new DoubleValue(0.2);
Note: See TracChangeset
for help on using the changeset viewer.