Changeset 3060 for trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/Tests/MichalewiczNonUniformAllPositionsManipulatorTest.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/MichalewiczNonUniformAllPositionsManipulatorTest.cs
r3053 r3060 85 85 public void MichalewiczNonUniformAllPositionsManipulatorApplyTest() { 86 86 TestRandom random = new TestRandom(); 87 DoubleArrayparent, expected;87 RealVector parent, expected; 88 88 DoubleValue min, max, generationsDependency; 89 89 IntValue currentGeneration, maximumGenerations; … … 92 92 random.Reset(); 93 93 random.DoubleNumbers = new double[] { 0.2, 0.5, 0.7, 0.8, 0.9, 0.5, 0.2, 0.5, 0.7, 0.8 }; 94 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });95 expected = new DoubleArray(new double[] { 0.45, 0.22, 0.3, 0.6, 0.14 });94 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 95 expected = new RealVector(new double[] { 0.45, 0.22, 0.3, 0.6, 0.14 }); 96 96 min = new DoubleValue(0.3); 97 97 max = new DoubleValue(0.7); … … 100 100 maximumGenerations = new IntValue(4); 101 101 MichalewiczNonUniformAllPositionsManipulator.Apply(random, parent, min, max, currentGeneration, maximumGenerations, generationsDependency); 102 Assert.IsTrue(Auxiliary. RealVectorIsAlmostEqualByPosition(expected, parent));102 Assert.IsTrue(Auxiliary.DoubleArrayIsAlmostEqualByPosition(expected, parent)); 103 103 // The following test is not based on published examples 104 104 exceptionFired = false; 105 105 random.Reset(); 106 106 random.DoubleNumbers = new double[] { 0.2, 0.5, 0.7, 0.8, 0.9, 0.5, 0.2, 0.5, 0.7, 0.8 }; 107 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });107 parent = new RealVector(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 108 108 min = new DoubleValue(0.3); 109 109 max = new DoubleValue(0.7);
Note: See TracChangeset
for help on using the changeset viewer.