Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/23/16 19:33:03 (8 years ago)
Author:
bburlacu
Message:

#2685: Revert accidental commit.

Location:
trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/AckleyEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void AckleyEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(AckleyEvaluator));
     39      AckleyEvaluator target = new AckleyEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/BealeEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void BealeEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(BealeEvaluator));
     39      BealeEvaluator target = new BealeEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/BoothEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void BoothEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(BoothEvaluator));
     39      BoothEvaluator target = new BoothEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/GriewankEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void GriewankEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(GriewankEvaluator));
     39      GriewankEvaluator target = new GriewankEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/LevyEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void LevyEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(LevyEvaluator));
     39      LevyEvaluator target = new LevyEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/MatyasEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void MatyasEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(MatyasEvaluator));
     39      MatyasEvaluator target = new MatyasEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/RastriginEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void RastriginEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(RastriginEvaluator));
     39      RastriginEvaluator target = new RastriginEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/RosenbrockEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void RosenbrockEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(RosenbrockEvaluator));
     39      RosenbrockEvaluator target = new RosenbrockEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/SphereEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void SphereEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(SphereEvaluator));
     39      SphereEvaluator target = new SphereEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/SumSquaresEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void SumSquaresEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(SumSquaresEvaluator));
     39      SumSquaresEvaluator target = new SumSquaresEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.TestFunctions-3.3/ZakharovEvaluatorTest.cs

    r14353 r14354  
    3737    [TestProperty("Time", "short")]
    3838    public void ZakharovEvaluateFunctionTest() {
    39       var privateObject = new PrivateObject(typeof(ZakharovEvaluator));
     39      ZakharovEvaluator target = new ZakharovEvaluator();
    4040      RealVector point = null;
    41       double expected = (double)privateObject.GetProperty("BestKnownQuality");
     41      double expected = target.BestKnownQuality;
    4242      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);
    4846        Assert.AreEqual(expected, actual);
    4947      }
Note: See TracChangeset for help on using the changeset viewer.