Changeset 3154 for trunk/sources/HeuristicLab.Problems.TestFunctions.SingleObjective/3.3/Evaluators/BealeEvaluator.cs
- Timestamp:
- 03/22/10 01:20:49 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TestFunctions.SingleObjective/3.3/Evaluators/BealeEvaluator.cs
r3150 r3154 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-20 08Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Text; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 25 27 26 namespace HeuristicLab. TestFunctions {28 namespace HeuristicLab.Problems.TestFunctions.SingleObjective { 27 29 /// <summary> 28 30 /// Beale Function<br/> … … 30 32 /// Optimum: 0.0 at (3.0, 0.5) 31 33 /// </summary> 32 public class BealeEvaluator : TestFunctionEvaluatorBase { 33 /// <inheritdoc select="summary"/> 34 public override string Description { 35 get { return 36 @"Beale Function 37 38 Domain: [-4.5 , 4.5]^2 39 Optimum: 0.0 at (3.0, 0.5)"; 40 } 34 [Item("BealeEvaluator", "Evaluates the Beale function on a given point. The optimum of this function is 0 at (3,0.5).")] 35 [StorableClass] 36 public class BealeEvaluator : SingleObjectiveTestFunctionEvaluator { 37 /// <summary> 38 /// Returns false as the Beale function is a minimization problem. 39 /// </summary> 40 public override bool Maximization { 41 get { return false; } 42 } 43 /// <summary> 44 /// Gets the optimum function value (0). 45 /// </summary> 46 public override double BestKnownQuality { 47 get { return 0; } 48 } 49 /// <summary> 50 /// Gets the lower and upper bound of the function. 51 /// </summary> 52 public override DoubleMatrix Bounds { 53 get { return new DoubleMatrix(new double[,] { { -4.5, 4.5 } }); } 54 } 55 /// <summary> 56 /// Gets the minimum problem size (2). 57 /// </summary> 58 public override int MinimumProblemSize { 59 get { return 2; } 60 } 61 /// <summary> 62 /// Gets the maximum problem size (2). 63 /// </summary> 64 public override int MaximumProblemSize { 65 get { return 2; } 41 66 } 42 67 … … 46 71 /// <param name="point">N-dimensional point for which the test function should be evaluated.</param> 47 72 /// <returns>The result value of the Beale function at the given point.</returns> 48 public static double Apply( double[]point) {73 public static double Apply(RealVector point) { 49 74 return Math.Pow(1.5 - point[0] * (1 - point[1]), 2) + Math.Pow(2.25 - point[0] * (1 - (point[1] * point[1])), 2) + Math.Pow((2.625 - point[0] * (1 - (point[1] * point[1] * point[1]))), 2); 50 75 } … … 56 81 /// <param name="point">N-dimensional point for which the test function should be evaluated.</param> 57 82 /// <returns>The result value of the Beale function at the given point.</returns> 58 protected override double EvaluateFunction( double[]point) {83 protected override double EvaluateFunction(RealVector point) { 59 84 return Apply(point); 60 85 }
Note: See TracChangeset
for help on using the changeset viewer.