- Timestamp:
- 11/25/15 23:24:01 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions
- Files:
-
- 15 deleted
- 15 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Ackley.cs
r13393 r13403 32 32 /// is highly multimodal. It has a single global minimum at the origin with value 0. 33 33 /// </summary 34 [Item("Ackley Evaluator", "Evaluates the Ackley function on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]34 [Item("Ackley", "Evaluates the Ackley function on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")] 35 35 [StorableClass] 36 public class AckleyEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 37 public override string FunctionName { get { return "Ackley"; } } 36 public class Ackley : SingleObjectiveTestFunction { 38 37 /// <summary> 39 38 /// Returns false as the Ackley function is a minimization problem. … … 68 67 69 68 [StorableConstructor] 70 protected Ackley Evaluator(bool deserializing) : base(deserializing) { }71 protected Ackley Evaluator(AckleyEvaluatororiginal, Cloner cloner) : base(original, cloner) { }72 public Ackley Evaluator() : base() { }69 protected Ackley(bool deserializing) : base(deserializing) { } 70 protected Ackley(Ackley original, Cloner cloner) : base(original, cloner) { } 71 public Ackley() : base() { } 73 72 74 73 public override IDeepCloneable Clone(Cloner cloner) { 75 return new Ackley Evaluator(this, cloner);74 return new Ackley(this, cloner); 76 75 } 77 76 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Beale.cs
r13393 r13403 32 32 /// It is implemented as described in Moré, J.J., Garbow, B., and Hillstrom, K. 1981. Testing unconstrained optimization software. ACM Transactions on Mathematical Software 7, pp. 136-140, ACM. 33 33 /// </summary> 34 [Item("Beale Evaluator", "Evaluates the Beale function on a given point. The optimum of this function is 0 at (3,0.5). It is implemented as described in Moré, J.J., Garbow, B., and Hillstrom, K. 1981. Testing unconstrained optimization software. ACM Transactions on Mathematical Software 7, pp. 136-140, ACM.")]34 [Item("Beale", "Evaluates the Beale function on a given point. The optimum of this function is 0 at (3,0.5). It is implemented as described in Moré, J.J., Garbow, B., and Hillstrom, K. 1981. Testing unconstrained optimization software. ACM Transactions on Mathematical Software 7, pp. 136-140, ACM.")] 35 35 [StorableClass] 36 public class BealeEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 37 public override string FunctionName { get { return "Beale"; } } 36 public class Beale : SingleObjectiveTestFunction { 38 37 /// <summary> 39 38 /// Returns false as the Beale function is a minimization problem. … … 68 67 69 68 [StorableConstructor] 70 protected Beale Evaluator(bool deserializing) : base(deserializing) { }71 protected Beale Evaluator(BealeEvaluatororiginal, Cloner cloner) : base(original, cloner) { }72 public Beale Evaluator() : base() { }69 protected Beale(bool deserializing) : base(deserializing) { } 70 protected Beale(Beale original, Cloner cloner) : base(original, cloner) { } 71 public Beale() : base() { } 73 72 74 73 public override IDeepCloneable Clone(Cloner cloner) { 75 return new Beale Evaluator(this, cloner);74 return new Beale(this, cloner); 76 75 } 77 76 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Booth.cs
r13393 r13403 31 31 /// The Booth function is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page816.htm, last accessed April 12th, 2010. 32 32 /// </summary> 33 [Item("Booth Evaluator", "Evaluates the Booth function on a given point. The optimum of this function is 0 at (1,3). It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page816.htm, last accessed April 12th, 2010.")]33 [Item("Booth", "Evaluates the Booth function on a given point. The optimum of this function is 0 at (1,3). It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page816.htm, last accessed April 12th, 2010.")] 34 34 [StorableClass] 35 public class BoothEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 36 public override string FunctionName { get { return "Booth"; } } 35 public class Booth : SingleObjectiveTestFunction { 37 36 /// <summary> 38 37 /// Returns false as the Booth function is a minimization problem. … … 67 66 68 67 [StorableConstructor] 69 protected Booth Evaluator(bool deserializing) : base(deserializing) { }70 protected Booth Evaluator(BoothEvaluatororiginal, Cloner cloner) : base(original, cloner) { }71 public Booth Evaluator() : base() { }68 protected Booth(bool deserializing) : base(deserializing) { } 69 protected Booth(Booth original, Cloner cloner) : base(original, cloner) { } 70 public Booth() : base() { } 72 71 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 return new Booth Evaluator(this, cloner);73 return new Booth(this, cloner); 75 74 } 76 75 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Griewank.cs
r13393 r13403 33 33 /// Here it is implemented as described (without the modifications) in Locatelli, M. 2003. A note on the Griewank test function. Journal of Global Optimization 25, pp. 169-174, Springer. 34 34 /// </summary> 35 [Item("Griewank Evaluator", "Evaluates the Griewank function on a given point. The optimum of this function is 0 at the origin. It is introduced by Griewank A.O. 1981 and implemented as described (without the modifications) in Locatelli, M. 2003. A note on the Griewank test function. Journal of Global Optimization 25, pp. 169-174, Springer.")]35 [Item("Griewank", "Evaluates the Griewank function on a given point. The optimum of this function is 0 at the origin. It is introduced by Griewank A.O. 1981 and implemented as described (without the modifications) in Locatelli, M. 2003. A note on the Griewank test function. Journal of Global Optimization 25, pp. 169-174, Springer.")] 36 36 [StorableClass] 37 public class GriewankEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 38 public override string FunctionName { get { return "Griewank"; } } 37 public class Griewank : SingleObjectiveTestFunction { 39 38 /// <summary> 40 39 /// Returns false as the Griewank function is a minimization problem. … … 69 68 70 69 [StorableConstructor] 71 protected Griewank Evaluator(bool deserializing) : base(deserializing) { }72 protected Griewank Evaluator(GriewankEvaluatororiginal, Cloner cloner) : base(original, cloner) { }73 public Griewank Evaluator() : base() { }70 protected Griewank(bool deserializing) : base(deserializing) { } 71 protected Griewank(Griewank original, Cloner cloner) : base(original, cloner) { } 72 public Griewank() : base() { } 74 73 75 74 public override IDeepCloneable Clone(Cloner cloner) { 76 return new Griewank Evaluator(this, cloner);75 return new Griewank(this, cloner); 77 76 } 78 77 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Levy.cs
r13393 r13403 31 31 /// The Levy function is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2056.htm, last accessed April 12th, 2010. 32 32 /// </summary> 33 [Item("Levy Evaluator", "Evaluates the Levy function on a given point. The optimum of this function is 0 at (1,1,...,1). It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2056.htm, last accessed April 12th, 2010.")]33 [Item("Levy", "Evaluates the Levy function on a given point. The optimum of this function is 0 at (1,1,...,1). It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2056.htm, last accessed April 12th, 2010.")] 34 34 [StorableClass] 35 public class LevyEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 36 public override string FunctionName { get { return "Levy"; } } 35 public class Levy : SingleObjectiveTestFunction { 37 36 /// <summary> 38 37 /// Returns false as the Levy function is a minimization problem. … … 67 66 68 67 [StorableConstructor] 69 protected Levy Evaluator(bool deserializing) : base(deserializing) { }70 protected Levy Evaluator(LevyEvaluatororiginal, Cloner cloner) : base(original, cloner) { }71 public Levy Evaluator() : base() { }68 protected Levy(bool deserializing) : base(deserializing) { } 69 protected Levy(Levy original, Cloner cloner) : base(original, cloner) { } 70 public Levy() : base() { } 72 71 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 return new Levy Evaluator(this, cloner);73 return new Levy(this, cloner); 75 74 } 76 75 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Matyas.cs
r13393 r13403 31 31 /// The Matyas function is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2213.htm, last accessed April 12th, 2010. 32 32 /// </summary> 33 [Item("Matyas Evaluator", "Evaluates the Matyas function on a given point. The optimum of this function is 0 at the origin. It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2213.htm, last accessed April 12th, 2010.")]33 [Item("Matyas", "Evaluates the Matyas function on a given point. The optimum of this function is 0 at the origin. It is implemented as described on http://www-optima.amp.i.kyoto-u.ac.jp/member/student/hedar/Hedar_files/TestGO_files/Page2213.htm, last accessed April 12th, 2010.")] 34 34 [StorableClass] 35 public class MatyasEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 36 public override string FunctionName { get { return "Matyas"; } } 35 public class Matyas : SingleObjectiveTestFunction { 37 36 /// <summary> 38 37 /// Returns false as the Matyas function is a minimization problem. … … 67 66 68 67 [StorableConstructor] 69 protected Matyas Evaluator(bool deserializing) : base(deserializing) { }70 protected Matyas Evaluator(MatyasEvaluatororiginal, Cloner cloner) : base(original, cloner) { }71 public Matyas Evaluator() : base() { }68 protected Matyas(bool deserializing) : base(deserializing) { } 69 protected Matyas(Matyas original, Cloner cloner) : base(original, cloner) { } 70 public Matyas() : base() { } 72 71 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 return new Matyas Evaluator(this, cloner);73 return new Matyas(this, cloner); 75 74 } 76 75 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Multinormal.cs
r13393 r13403 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 using HeuristicLab.Random; 32 33 33 34 namespace HeuristicLab.Problems.TestFunctions.Evaluators { 34 [Item("Multinormal Function", "Evaluates a random multinormal function on a given point.")]35 [Item("Multinormal", "Evaluates a random multinormal function on a given point.")] 35 36 [StorableClass] 36 public class MultinormalEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 37 public override string FunctionName { get { return "Multinormal"; } } 37 public class Multinormal : SingleObjectiveTestFunction { 38 38 39 39 private ItemList<RealVector> centers { … … 45 45 set { Parameters["s^2s"].ActualValue = value; } 46 46 } 47 private static System.Random Random = new System.Random(); 47 48 public IRandom Random { 49 get { return ((ValueParameter<IRandom>)Parameters["Random"]).Value; } 50 set { ((ValueParameter<IRandom>)Parameters["Random"]).Value = value; } 51 } 48 52 49 53 private Dictionary<int, List<RealVector>> stdCenters; … … 87 91 88 92 [StorableConstructor] 89 protected Multinormal Evaluator(bool deserializing) : base(deserializing) { }90 protected Multinormal Evaluator(MultinormalEvaluatororiginal, Cloner cloner) : base(original, cloner) { }91 public Multinormal Evaluator() {93 protected Multinormal(bool deserializing) : base(deserializing) { } 94 protected Multinormal(Multinormal original, Cloner cloner) : base(original, cloner) { } 95 public Multinormal() { 92 96 Parameters.Add(new ValueParameter<ItemList<RealVector>>("Centers", "Centers of normal distributions")); 93 97 Parameters.Add(new ValueParameter<RealVector>("s^2s", "sigma^2 of normal distributions")); 94 Parameters.Add(new LookupParameter<IRandom>("Random", "Random number generator"));98 Parameters.Add(new ValueParameter<IRandom>("Random", "The random number generator that will make random instances", new MersenneTwister(0))); 95 99 centers = new ItemList<RealVector>(); 96 100 s_2s = new RealVector(); … … 98 102 99 103 public override IDeepCloneable Clone(Cloner cloner) { 100 return new Multinormal Evaluator(this, cloner);104 return new Multinormal(this, cloner); 101 105 } 102 106 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Random.cs
r13393 r13403 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Optimization;27 26 using HeuristicLab.Parameters; 28 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 28 using HeuristicLab.Random; 29 29 30 30 namespace HeuristicLab.Problems.TestFunctions { … … 32 32 /// A function that returns a random variable in [0;1) independent of the inputs. 33 33 /// </summary 34 [Item("Random Evaluator", "Returns a random value in [0;1) that is independent of the inputs.")]34 [Item("Random", "Returns a random value in [0;1) that is independent of the inputs.")] 35 35 [StorableClass] 36 public class RandomEvaluator : SingleObjectiveTestFunctionProblemEvaluator, IStochasticOperator { 37 public override string FunctionName { get { return "Random"; } } 36 public class Random : SingleObjectiveTestFunction { 38 37 /// <summary> 39 38 /// It does not really matter. … … 67 66 } 68 67 69 public I LookupParameter<IRandom> RandomParameter {70 get { return (I LookupParameter<IRandom>)Parameters["Random"]; }68 public IValueParameter<IRandom> RandomParameter { 69 get { return (IValueParameter<IRandom>)Parameters["Random"]; } 71 70 } 72 71 73 72 [StorableConstructor] 74 protected Random Evaluator(bool deserializing) : base(deserializing) { }75 protected Random Evaluator(RandomEvaluatororiginal, Cloner cloner) : base(original, cloner) { }76 public Random Evaluator()73 protected Random(bool deserializing) : base(deserializing) { } 74 protected Random(Random original, Cloner cloner) : base(original, cloner) { } 75 public Random() 77 76 : base() { 78 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));77 Parameters.Add(new ValueParameter<IRandom>("Random", "The random number generator to use.", new MersenneTwister(0))); 79 78 } 80 79 81 80 public override IDeepCloneable Clone(Cloner cloner) { 82 return new Random Evaluator(this, cloner);81 return new Random(this, cloner); 83 82 } 84 83 85 84 public override RealVector GetBestKnownSolution(int dimension) { 86 return n ew RealVector(dimension);85 return null; 87 86 } 88 87 89 88 public override double Evaluate(RealVector point) { 90 return ExecutionContext == null ? new System.Random().NextDouble() : RandomParameter.ActualValue.NextDouble();89 return RandomParameter.Value.NextDouble(); 91 90 } 92 91 } -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Rastrigin.cs
r13393 r13403 33 33 /// It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg. 34 34 /// </summary 35 [Item("Rastrigin Evaluator", "Evaluates the generalized Rastrigin function y = Sum((x_i)^2 + A * (1 - Cos(2pi*x_i))) on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")]35 [Item("Rastrigin", "Evaluates the generalized Rastrigin function y = Sum((x_i)^2 + A * (1 - Cos(2pi*x_i))) on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Eiben, A.E. and Smith, J.E. 2003. Introduction to Evolutionary Computation. Natural Computing Series, Springer-Verlag Berlin Heidelberg.")] 36 36 [StorableClass] 37 public class RastriginEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 38 public override string FunctionName { get { return "Rastrigin"; } } 37 public class Rastrigin : SingleObjectiveTestFunction { 39 38 /// <summary> 40 39 /// Returns false as the Rastrigin function is a minimization problem. … … 86 85 87 86 [StorableConstructor] 88 protected Rastrigin Evaluator(bool deserializing) : base(deserializing) { }89 protected Rastrigin Evaluator(RastriginEvaluatororiginal, Cloner cloner) : base(original, cloner) { }87 protected Rastrigin(bool deserializing) : base(deserializing) { } 88 protected Rastrigin(Rastrigin original, Cloner cloner) : base(original, cloner) { } 90 89 /// <summary> 91 90 /// Initializes a new instance of the RastriginEvaluator with one parameter (<c>A</c>). 92 91 /// </summary> 93 public Rastrigin Evaluator()92 public Rastrigin() 94 93 : base() { 95 94 Parameters.Add(new ValueParameter<DoubleValue>("A", "The parameter A is a parameter of the objective function y = Sum((x_i)^2 + A * (1 - Cos(2pi*x_i))). Default is A = 10.", new DoubleValue(10))); … … 97 96 98 97 public override IDeepCloneable Clone(Cloner cloner) { 99 return new Rastrigin Evaluator(this, cloner);98 return new Rastrigin(this, cloner); 100 99 } 101 100 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Rosenbrock.cs
r13393 r13403 32 32 /// It is implemented as generalized Rosenbrock function as for example given in Shang, Y.-W. and Qiu, Y.-H. 2006. A Note on the Extended Rosenbrock Function. Evolutionary Computation 14, pp. 119-126, MIT Press. 33 33 /// </summary> 34 [Item("Rosenbrock Evaluator", @"The Rosenbrock function features a flat valley in which the global optimum is located.34 [Item("Rosenbrock", @"The Rosenbrock function features a flat valley in which the global optimum is located. 35 35 For 2 and 3 dimensions the single minimum of this function is 0 at (1,1,...,1), for 4 to 30 dimensions there is an additional local minimum close to (-1,1,...,1). 36 36 It is unknown how many local minima there are for dimensions greater than 30. 37 37 It is implemented as generalized Rosenbrock function for which the 2 dimensional function is a special case, as for example given in Shang, Y.-W. and Qiu, Y.-H. 2006. A Note on the Extended Rosenbrock Function. Evolutionary Computation 14, pp. 119-126, MIT Press.")] 38 38 [StorableClass] 39 public class RosenbrockEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 40 public override string FunctionName { get { return "Rosenbrock"; } } 39 public class Rosenbrock : SingleObjectiveTestFunction { 41 40 /// <summary> 42 41 /// Returns false as the Rosenbrock function is a minimization problem. … … 71 70 72 71 [StorableConstructor] 73 protected Rosenbrock Evaluator(bool deserializing) : base(deserializing) { }74 protected Rosenbrock Evaluator(RosenbrockEvaluatororiginal, Cloner cloner) : base(original, cloner) { }75 public Rosenbrock Evaluator() : base() { }72 protected Rosenbrock(bool deserializing) : base(deserializing) { } 73 protected Rosenbrock(Rosenbrock original, Cloner cloner) : base(original, cloner) { } 74 public Rosenbrock() : base() { } 76 75 77 76 public override IDeepCloneable Clone(Cloner cloner) { 78 return new Rosenbrock Evaluator(this, cloner);77 return new Rosenbrock(this, cloner); 79 78 } 80 79 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Schwefel.cs
r13393 r13403 31 31 /// The Schwefel function (sine root) is implemented as described in Affenzeller, M. and Wagner, S. 2005. Offspring Selection: A New Self-Adaptive Selection Scheme for Genetic Algorithms. Ribeiro, B., Albrecht, R. F., Dobnikar, A., Pearson, D. W., and Steele, N. C. (eds.). Adaptive and Natural Computing Algorithms, pp. 218-221, Springer. 32 32 /// </summary> 33 [Item("Schwefel Evaluator", "Evaluates the Schwefel function (sine root) on a given point. In the given bounds [-500;500] the optimum of this function is close to 0 at (420.968746453712,420.968746453712,...,420.968746453712). It is implemented as described in Affenzeller, M. and Wagner, S. 2005. Offspring Selection: A New Self-Adaptive Selection Scheme for Genetic Algorithms. Ribeiro, B., Albrecht, R. F., Dobnikar, A., Pearson, D. W., and Steele, N. C. (eds.). Adaptive and Natural Computing Algorithms, pp. 218-221, Springer.")]33 [Item("Schwefel", "Evaluates the Schwefel function (sine root) on a given point. In the given bounds [-500;500] the optimum of this function is close to 0 at (420.968746453712,420.968746453712,...,420.968746453712). It is implemented as described in Affenzeller, M. and Wagner, S. 2005. Offspring Selection: A New Self-Adaptive Selection Scheme for Genetic Algorithms. Ribeiro, B., Albrecht, R. F., Dobnikar, A., Pearson, D. W., and Steele, N. C. (eds.). Adaptive and Natural Computing Algorithms, pp. 218-221, Springer.")] 34 34 [StorableClass] 35 public class SchwefelEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 36 public override string FunctionName { get { return "Schwefel"; } } 35 public class Schwefel : SingleObjectiveTestFunction { 37 36 /// <summary> 38 37 /// Returns false as the Schwefel (sine root) function is a minimization problem. … … 67 66 68 67 [StorableConstructor] 69 protected Schwefel Evaluator(bool deserializing) : base(deserializing) { }70 protected Schwefel Evaluator(SchwefelEvaluatororiginal, Cloner cloner) : base(original, cloner) { }71 public Schwefel Evaluator() : base() { }68 protected Schwefel(bool deserializing) : base(deserializing) { } 69 protected Schwefel(Schwefel original, Cloner cloner) : base(original, cloner) { } 70 public Schwefel() : base() { } 72 71 73 72 public override IDeepCloneable Clone(Cloner cloner) { 74 return new Schwefel Evaluator(this, cloner);73 return new Schwefel(this, cloner); 75 74 } 76 75 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/SingleObjectiveTestFunction.cs
r13393 r13403 24 24 using HeuristicLab.Data; 25 25 using HeuristicLab.Encodings.RealVectorEncoding; 26 using HeuristicLab.Operators;27 using HeuristicLab.Parameters;28 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 27 … … 32 30 /// Base class for a test function evaluator. 33 31 /// </summary> 34 [Item(" Evaluator", "Base calls for single objective test function evaluators.")]32 [Item("Single-Objective Function", "Base class for single objective functions.")] 35 33 [StorableClass] 36 public abstract class SingleObjectiveTestFunctionProblemEvaluator : InstrumentedOperator, ISingleObjectiveTestFunctionProblemEvaluator { 37 /// <summary> 38 /// The name of the function 39 /// </summary> 40 public abstract string FunctionName { get; } 34 public abstract class SingleObjectiveTestFunction : ParameterizedNamedItem, ISingleObjectiveTestFunction { 41 35 /// <summary> 42 36 /// These operators should not change their name through the GUI … … 66 60 public abstract int MaximumProblemSize { get; } 67 61 68 public ILookupParameter<DoubleValue> QualityParameter {69 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }70 }71 public ILookupParameter<RealVector> PointParameter {72 get { return (ILookupParameter<RealVector>)Parameters["Point"]; }73 }74 75 62 [StorableConstructor] 76 protected SingleObjectiveTestFunctionProblemEvaluator(bool deserializing) : base(deserializing) { } 77 protected SingleObjectiveTestFunctionProblemEvaluator(SingleObjectiveTestFunctionProblemEvaluator original, Cloner cloner) : base(original, cloner) { } 78 /// <summary> 79 /// Initializes a new instance of <see cref="SingleObjectiveTestFunctionEvaluator"/> with two parameters 80 /// (<c>Quality</c> and <c>Point</c>). 81 /// </summary> 82 public SingleObjectiveTestFunctionProblemEvaluator() 83 : base() { 84 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "Result of the evaluation of a solution.")); 85 Parameters.Add(new LookupParameter<RealVector>("Point", "The point at which the function should be evaluated.")); 86 } 87 88 public override IOperation InstrumentedApply() { 89 RealVector point = PointParameter.ActualValue; 90 double quality = Evaluate(point); 91 QualityParameter.ActualValue = new DoubleValue(quality); 92 return base.InstrumentedApply(); 93 } 63 protected SingleObjectiveTestFunction(bool deserializing) : base(deserializing) { } 64 protected SingleObjectiveTestFunction(SingleObjectiveTestFunction original, Cloner cloner) : base(original, cloner) { } 65 protected SingleObjectiveTestFunction() : base() { } 94 66 95 67 public virtual double Evaluate2D(double x, double y) { -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Sphere.cs
r13393 r13403 33 33 /// It is implemented as described in Beyer, H.-G. and Schwefel, H.-P. 2002. Evolution Strategies - A Comprehensive Introduction Natural Computing, 1, pp. 3-52. 34 34 /// </summary> 35 [Item("Sphere Evaluator", "Evaluates the Sphere function y = C * ||X||^Alpha on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Beyer, H.-G. and Schwefel, H.-P. 2002. Evolution Strategies - A Comprehensive Introduction Natural Computing, 1, pp. 3-52.")]35 [Item("Sphere", "Evaluates the Sphere function y = C * ||X||^Alpha on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Beyer, H.-G. and Schwefel, H.-P. 2002. Evolution Strategies - A Comprehensive Introduction Natural Computing, 1, pp. 3-52.")] 36 36 [StorableClass] 37 public class SphereEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 38 public override string FunctionName { get { return "Sphere"; } } 37 public class Sphere : SingleObjectiveTestFunction { 39 38 /// <summary> 40 39 /// Returns false as the Sphere function is a minimization problem. … … 69 68 70 69 public override IDeepCloneable Clone(Cloner cloner) { 71 return new Sphere Evaluator(this, cloner);70 return new Sphere(this, cloner); 72 71 } 73 72 … … 104 103 105 104 [StorableConstructor] 106 protected Sphere Evaluator(bool deserializing) : base(deserializing) { }107 protected Sphere Evaluator(SphereEvaluatororiginal, Cloner cloner) : base(original, cloner) { }105 protected Sphere(bool deserializing) : base(deserializing) { } 106 protected Sphere(Sphere original, Cloner cloner) : base(original, cloner) { } 108 107 /// <summary> 109 108 /// Initializes a new instance of the SphereEvaluator with two parameters (<c>C</c> and <c>Alpha</c>). 110 109 /// </summary> 111 public Sphere Evaluator()110 public Sphere() 112 111 : base() { 113 112 Parameters.Add(new ValueParameter<DoubleValue>("C", "The parameter C modifies the steepness of the objective function y = C * ||X||^Alpha. Default is C = 1.", new DoubleValue(1))); -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/SumSquares.cs
r13393 r13403 30 30 /// The Sum Squares function is defined as sum(i * x_i * x_i) for i = 1..n 31 31 /// </summary> 32 [Item("SumSquares Evaluator", "Evaluates the sum squares function on a given point. The optimum of this function is 0 at the origin. The Sum Squares function is defined as sum(i * x_i * x_i) for i = 1..n.")]32 [Item("SumSquares", "Evaluates the sum squares function on a given point. The optimum of this function is 0 at the origin. The Sum Squares function is defined as sum(i * x_i * x_i) for i = 1..n.")] 33 33 [StorableClass] 34 public class SumSquaresEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 35 public override string FunctionName { get { return "SumSquares"; } } 34 public class SumSquares : SingleObjectiveTestFunction { 36 35 /// <summary> 37 36 /// Returns false as the Sum Squares function is a minimization problem. … … 66 65 67 66 [StorableConstructor] 68 protected SumSquares Evaluator(bool deserializing) : base(deserializing) { }69 protected SumSquares Evaluator(SumSquaresEvaluatororiginal, Cloner cloner) : base(original, cloner) { }70 public SumSquares Evaluator() : base() { }67 protected SumSquares(bool deserializing) : base(deserializing) { } 68 protected SumSquares(SumSquares original, Cloner cloner) : base(original, cloner) { } 69 public SumSquares() : base() { } 71 70 72 71 public override IDeepCloneable Clone(Cloner cloner) { 73 return new SumSquares Evaluator(this, cloner);72 return new SumSquares(this, cloner); 74 73 } 75 74 -
branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Zakharov.cs
r13393 r13403 30 30 /// The Zakharov function is implemented as described in Hedar, A. & Fukushima, M. 2004. Heuristic pattern search and its hybridization with simulated annealing for nonlinear global optimization. Optimization Methods and Software 19, pp. 291-308, Taylor & Francis. 31 31 /// </summary> 32 [Item("Zakharov Evaluator", "Evaluates the Zakharov function on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Hedar, A. & Fukushima, M. 2004. Heuristic pattern search and its hybridization with simulated annealing for nonlinear global optimization. Optimization Methods and Software 19, pp. 291-308, Taylor & Francis.")]32 [Item("Zakharov", "Evaluates the Zakharov function on a given point. The optimum of this function is 0 at the origin. It is implemented as described in Hedar, A. & Fukushima, M. 2004. Heuristic pattern search and its hybridization with simulated annealing for nonlinear global optimization. Optimization Methods and Software 19, pp. 291-308, Taylor & Francis.")] 33 33 [StorableClass] 34 public class ZakharovEvaluator : SingleObjectiveTestFunctionProblemEvaluator { 35 public override string FunctionName { get { return "Zakharov"; } } 34 public class Zakharov : SingleObjectiveTestFunction { 36 35 /// <summary> 37 36 /// Returns false as the Zakharov function is a minimization problem. … … 70 69 71 70 [StorableConstructor] 72 protected Zakharov Evaluator(bool deserializing) : base(deserializing) { }73 protected Zakharov Evaluator(ZakharovEvaluatororiginal, Cloner cloner) : base(original, cloner) { }74 public Zakharov Evaluator() : base() { }71 protected Zakharov(bool deserializing) : base(deserializing) { } 72 protected Zakharov(Zakharov original, Cloner cloner) : base(original, cloner) { } 73 public Zakharov() : base() { } 75 74 76 75 public override IDeepCloneable Clone(Cloner cloner) { 77 return new Zakharov Evaluator(this, cloner);76 return new Zakharov(this, cloner); 78 77 } 79 78
Note: See TracChangeset
for help on using the changeset viewer.