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