Changeset 14353 for trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/AckleyEvaluatorTest.cs
- Timestamp:
- 10/23/16 19:31:18 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/AckleyEvaluatorTest.cs
r14185 r14353 37 37 [TestProperty("Time", "short")] 38 38 public void AckleyEvaluateFunctionTest() { 39 AckleyEvaluator target = new AckleyEvaluator();39 var privateObject = new PrivateObject(typeof(AckleyEvaluator)); 40 40 RealVector point = null; 41 double expected = target.BestKnownQuality;41 double expected = (double)privateObject.GetProperty("BestKnownQuality"); 42 42 double actual; 43 for (int dimension = target.MinimumProblemSize; dimension <= System.Math.Min(10, target.MaximumProblemSize); dimension++) { 44 point = target.GetBestKnownSolution(dimension); 45 actual = target.Evaluate(point); 43 int minimumProblemSize = (int)privateObject.GetProperty("MinimumProblemSize"); 44 int maximumProblemSize = (int)privateObject.GetProperty("MaximumProblemSize"); 45 for (int dimension = minimumProblemSize; dimension <= System.Math.Min(10, maximumProblemSize); dimension++) { 46 point = (RealVector)privateObject.Invoke("GetBestKnownSolution", dimension); 47 actual = (double)privateObject.Invoke("Evaluate", point); 46 48 Assert.AreEqual(expected, actual); 47 49 }
Note: See TracChangeset
for help on using the changeset viewer.