Changeset 3048 for trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Tests/MichalewiczNonUniformOnePositionManipulatorTest.cs
- Timestamp:
- 03/15/10 23:49:54 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.RealVector/3.3/Tests/MichalewiczNonUniformOnePositionManipulatorTest.cs
r2936 r3048 85 85 public void MichalewiczNonUniformOnePositionManipulatorApplyTest() { 86 86 TestRandom random = new TestRandom(); 87 DoubleArray Dataparent, expected;88 Double Datamin, max, generationsDependency;89 Int DatacurrentGeneration, maximumGenerations;87 DoubleArray parent, expected; 88 DoubleValue min, max, generationsDependency; 89 IntValue currentGeneration, maximumGenerations; 90 90 bool exceptionFired; 91 91 // The following test is not based on published examples … … 93 93 random.IntNumbers = new int[] { 3 }; 94 94 random.DoubleNumbers = new double[] { 0.2, 0.7 }; 95 parent = new DoubleArray Data(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });96 expected = new DoubleArray Data(new double[] { 0.2, 0.2, 0.3, 0.34, 0.1 });97 min = new Double Data(0.3);98 max = new Double Data(0.7);99 generationsDependency = new Double Data(0.1);100 currentGeneration = new Int Data(1);101 maximumGenerations = new Int Data(4);95 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 96 expected = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.34, 0.1 }); 97 min = new DoubleValue(0.3); 98 max = new DoubleValue(0.7); 99 generationsDependency = new DoubleValue(0.1); 100 currentGeneration = new IntValue(1); 101 maximumGenerations = new IntValue(4); 102 102 MichalewiczNonUniformOnePositionManipulator.Apply(random, parent, min, max, currentGeneration, maximumGenerations, generationsDependency); 103 103 Assert.IsTrue(Auxiliary.RealVectorIsAlmostEqualByPosition(expected, parent)); … … 107 107 random.IntNumbers = new int[] { 3 }; 108 108 random.DoubleNumbers = new double[] { 0.2, 0.7 }; 109 parent = new DoubleArray Data(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 });110 min = new Double Data(0.3);111 max = new Double Data(0.7);112 generationsDependency = new Double Data(0.1);113 currentGeneration = new Int Data(5); //current generation > max generation114 maximumGenerations = new Int Data(4);109 parent = new DoubleArray(new double[] { 0.2, 0.2, 0.3, 0.5, 0.1 }); 110 min = new DoubleValue(0.3); 111 max = new DoubleValue(0.7); 112 generationsDependency = new DoubleValue(0.1); 113 currentGeneration = new IntValue(5); //current generation > max generation 114 maximumGenerations = new IntValue(4); 115 115 try { 116 116 MichalewiczNonUniformOnePositionManipulator.Apply(random, parent, min, max, currentGeneration, maximumGenerations, generationsDependency);
Note: See TracChangeset
for help on using the changeset viewer.