Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/25/15 23:24:01 (9 years ago)
Author:
abeham
Message:

#2521:

  • Adapted single-objective test function problem to new problem infrastructure
  • Added additional interfaces to RealVectorEncoding
  • Fixed IParticleUpdater interface (must implement IStochasticOperator if it contains a Random parameter)
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  
    3232  /// is highly multimodal. It has a single global minimum at the origin with value 0.
    3333  /// </summary
    34   [Item("AckleyEvaluator", "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.")]
    3535  [StorableClass]
    36   public class AckleyEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    37     public override string FunctionName { get { return "Ackley"; } }
     36  public class Ackley : SingleObjectiveTestFunction {
    3837    /// <summary>
    3938    /// Returns false as the Ackley function is a minimization problem.
     
    6867
    6968    [StorableConstructor]
    70     protected AckleyEvaluator(bool deserializing) : base(deserializing) { }
    71     protected AckleyEvaluator(AckleyEvaluator original, Cloner cloner) : base(original, cloner) { }
    72     public AckleyEvaluator() : base() { }
     69    protected Ackley(bool deserializing) : base(deserializing) { }
     70    protected Ackley(Ackley original, Cloner cloner) : base(original, cloner) { }
     71    public Ackley() : base() { }
    7372
    7473    public override IDeepCloneable Clone(Cloner cloner) {
    75       return new AckleyEvaluator(this, cloner);
     74      return new Ackley(this, cloner);
    7675    }
    7776
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Beale.cs

    r13393 r13403  
    3232  /// 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.
    3333  /// </summary>
    34   [Item("BealeEvaluator", "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.")]
    3535  [StorableClass]
    36   public class BealeEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    37     public override string FunctionName { get { return "Beale"; } }
     36  public class Beale : SingleObjectiveTestFunction {
    3837    /// <summary>
    3938    /// Returns false as the Beale function is a minimization problem.
     
    6867
    6968    [StorableConstructor]
    70     protected BealeEvaluator(bool deserializing) : base(deserializing) { }
    71     protected BealeEvaluator(BealeEvaluator original, Cloner cloner) : base(original, cloner) { }
    72     public BealeEvaluator() : base() { }
     69    protected Beale(bool deserializing) : base(deserializing) { }
     70    protected Beale(Beale original, Cloner cloner) : base(original, cloner) { }
     71    public Beale() : base() { }
    7372
    7473    public override IDeepCloneable Clone(Cloner cloner) {
    75       return new BealeEvaluator(this, cloner);
     74      return new Beale(this, cloner);
    7675    }
    7776
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Booth.cs

    r13393 r13403  
    3131  /// 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.
    3232  /// </summary>
    33   [Item("BoothEvaluator", "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.")]
    3434  [StorableClass]
    35   public class BoothEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    36     public override string FunctionName { get { return "Booth"; } }
     35  public class Booth : SingleObjectiveTestFunction {
    3736    /// <summary>
    3837    /// Returns false as the Booth function is a minimization problem.
     
    6766
    6867    [StorableConstructor]
    69     protected BoothEvaluator(bool deserializing) : base(deserializing) { }
    70     protected BoothEvaluator(BoothEvaluator original, Cloner cloner) : base(original, cloner) { }
    71     public BoothEvaluator() : base() { }
     68    protected Booth(bool deserializing) : base(deserializing) { }
     69    protected Booth(Booth original, Cloner cloner) : base(original, cloner) { }
     70    public Booth() : base() { }
    7271
    7372    public override IDeepCloneable Clone(Cloner cloner) {
    74       return new BoothEvaluator(this, cloner);
     73      return new Booth(this, cloner);
    7574    }
    7675
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Griewank.cs

    r13393 r13403  
    3333  /// 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.
    3434  /// </summary>
    35   [Item("GriewankEvaluator", "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.")]
    3636  [StorableClass]
    37   public class GriewankEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    38     public override string FunctionName { get { return "Griewank"; } }
     37  public class Griewank : SingleObjectiveTestFunction {
    3938    /// <summary>
    4039    /// Returns false as the Griewank function is a minimization problem.
     
    6968
    7069    [StorableConstructor]
    71     protected GriewankEvaluator(bool deserializing) : base(deserializing) { }
    72     protected GriewankEvaluator(GriewankEvaluator original, Cloner cloner) : base(original, cloner) { }
    73     public GriewankEvaluator() : base() { }
     70    protected Griewank(bool deserializing) : base(deserializing) { }
     71    protected Griewank(Griewank original, Cloner cloner) : base(original, cloner) { }
     72    public Griewank() : base() { }
    7473
    7574    public override IDeepCloneable Clone(Cloner cloner) {
    76       return new GriewankEvaluator(this, cloner);
     75      return new Griewank(this, cloner);
    7776    }
    7877
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Levy.cs

    r13393 r13403  
    3131  /// 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.
    3232  /// </summary>
    33   [Item("LevyEvaluator", "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.")]
    3434  [StorableClass]
    35   public class LevyEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    36     public override string FunctionName { get { return "Levy"; } }
     35  public class Levy : SingleObjectiveTestFunction {
    3736    /// <summary>
    3837    /// Returns false as the Levy function is a minimization problem.
     
    6766
    6867    [StorableConstructor]
    69     protected LevyEvaluator(bool deserializing) : base(deserializing) { }
    70     protected LevyEvaluator(LevyEvaluator original, Cloner cloner) : base(original, cloner) { }
    71     public LevyEvaluator() : base() { }
     68    protected Levy(bool deserializing) : base(deserializing) { }
     69    protected Levy(Levy original, Cloner cloner) : base(original, cloner) { }
     70    public Levy() : base() { }
    7271
    7372    public override IDeepCloneable Clone(Cloner cloner) {
    74       return new LevyEvaluator(this, cloner);
     73      return new Levy(this, cloner);
    7574    }
    7675
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Matyas.cs

    r13393 r13403  
    3131  /// 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.
    3232  /// </summary>
    33   [Item("MatyasEvaluator", "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.")]
    3434  [StorableClass]
    35   public class MatyasEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    36     public override string FunctionName { get { return "Matyas"; } }
     35  public class Matyas : SingleObjectiveTestFunction {
    3736    /// <summary>
    3837    /// Returns false as the Matyas function is a minimization problem.
     
    6766
    6867    [StorableConstructor]
    69     protected MatyasEvaluator(bool deserializing) : base(deserializing) { }
    70     protected MatyasEvaluator(MatyasEvaluator original, Cloner cloner) : base(original, cloner) { }
    71     public MatyasEvaluator() : base() { }
     68    protected Matyas(bool deserializing) : base(deserializing) { }
     69    protected Matyas(Matyas original, Cloner cloner) : base(original, cloner) { }
     70    public Matyas() : base() { }
    7271
    7372    public override IDeepCloneable Clone(Cloner cloner) {
    74       return new MatyasEvaluator(this, cloner);
     73      return new Matyas(this, cloner);
    7574    }
    7675
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Multinormal.cs

    r13393 r13403  
    3030using HeuristicLab.Parameters;
    3131using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     32using HeuristicLab.Random;
    3233
    3334namespace HeuristicLab.Problems.TestFunctions.Evaluators {
    34   [Item("MultinormalFunction", "Evaluates a random multinormal function on a given point.")]
     35  [Item("Multinormal", "Evaluates a random multinormal function on a given point.")]
    3536  [StorableClass]
    36   public class MultinormalEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    37     public override string FunctionName { get { return "Multinormal"; } }
     37  public class Multinormal : SingleObjectiveTestFunction {
    3838
    3939    private ItemList<RealVector> centers {
     
    4545      set { Parameters["s^2s"].ActualValue = value; }
    4646    }
    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    }
    4852
    4953    private Dictionary<int, List<RealVector>> stdCenters;
     
    8791
    8892    [StorableConstructor]
    89     protected MultinormalEvaluator(bool deserializing) : base(deserializing) { }
    90     protected MultinormalEvaluator(MultinormalEvaluator original, Cloner cloner) : base(original, cloner) { }
    91     public MultinormalEvaluator() {
     93    protected Multinormal(bool deserializing) : base(deserializing) { }
     94    protected Multinormal(Multinormal original, Cloner cloner) : base(original, cloner) { }
     95    public Multinormal() {
    9296      Parameters.Add(new ValueParameter<ItemList<RealVector>>("Centers", "Centers of normal distributions"));
    9397      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)));
    9599      centers = new ItemList<RealVector>();
    96100      s_2s = new RealVector();
     
    98102
    99103    public override IDeepCloneable Clone(Cloner cloner) {
    100       return new MultinormalEvaluator(this, cloner);
     104      return new Multinormal(this, cloner);
    101105    }
    102106
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Random.cs

    r13393 r13403  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
    26 using HeuristicLab.Optimization;
    2726using HeuristicLab.Parameters;
    2827using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Random;
    2929
    3030namespace HeuristicLab.Problems.TestFunctions {
     
    3232  /// A function that returns a random variable in [0;1) independent of the inputs.
    3333  /// </summary
    34   [Item("RandomEvaluator", "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.")]
    3535  [StorableClass]
    36   public class RandomEvaluator : SingleObjectiveTestFunctionProblemEvaluator, IStochasticOperator {
    37     public override string FunctionName { get { return "Random"; } }
     36  public class Random : SingleObjectiveTestFunction {
    3837    /// <summary>
    3938    /// It does not really matter.
     
    6766    }
    6867
    69     public ILookupParameter<IRandom> RandomParameter {
    70       get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     68    public IValueParameter<IRandom> RandomParameter {
     69      get { return (IValueParameter<IRandom>)Parameters["Random"]; }
    7170    }
    7271
    7372    [StorableConstructor]
    74     protected RandomEvaluator(bool deserializing) : base(deserializing) { }
    75     protected RandomEvaluator(RandomEvaluator original, Cloner cloner) : base(original, cloner) { }
    76     public RandomEvaluator()
     73    protected Random(bool deserializing) : base(deserializing) { }
     74    protected Random(Random original, Cloner cloner) : base(original, cloner) { }
     75    public Random()
    7776      : 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)));
    7978    }
    8079
    8180    public override IDeepCloneable Clone(Cloner cloner) {
    82       return new RandomEvaluator(this, cloner);
     81      return new Random(this, cloner);
    8382    }
    8483
    8584    public override RealVector GetBestKnownSolution(int dimension) {
    86       return new RealVector(dimension);
     85      return null;
    8786    }
    8887
    8988    public override double Evaluate(RealVector point) {
    90       return ExecutionContext == null ? new System.Random().NextDouble() : RandomParameter.ActualValue.NextDouble();
     89      return RandomParameter.Value.NextDouble();
    9190    }
    9291  }
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Rastrigin.cs

    r13393 r13403  
    3333  /// 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.
    3434  /// </summary
    35   [Item("RastriginEvaluator", "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.")]
    3636  [StorableClass]
    37   public class RastriginEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    38     public override string FunctionName { get { return "Rastrigin"; } }
     37  public class Rastrigin : SingleObjectiveTestFunction {
    3938    /// <summary>
    4039    /// Returns false as the Rastrigin function is a minimization problem.
     
    8685
    8786    [StorableConstructor]
    88     protected RastriginEvaluator(bool deserializing) : base(deserializing) { }
    89     protected RastriginEvaluator(RastriginEvaluator original, Cloner cloner) : base(original, cloner) { }
     87    protected Rastrigin(bool deserializing) : base(deserializing) { }
     88    protected Rastrigin(Rastrigin original, Cloner cloner) : base(original, cloner) { }
    9089    /// <summary>
    9190    /// Initializes a new instance of the RastriginEvaluator with one parameter (<c>A</c>).
    9291    /// </summary>
    93     public RastriginEvaluator()
     92    public Rastrigin()
    9493      : base() {
    9594      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)));
     
    9796
    9897    public override IDeepCloneable Clone(Cloner cloner) {
    99       return new RastriginEvaluator(this, cloner);
     98      return new Rastrigin(this, cloner);
    10099    }
    101100
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Rosenbrock.cs

    r13393 r13403  
    3232  /// 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.
    3333  /// </summary>
    34   [Item("RosenbrockEvaluator", @"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.
    3535For 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).
    3636It is unknown how many local minima there are for dimensions greater than 30.
    3737It 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.")]
    3838  [StorableClass]
    39   public class RosenbrockEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    40     public override string FunctionName { get { return "Rosenbrock"; } }
     39  public class Rosenbrock : SingleObjectiveTestFunction {
    4140    /// <summary>
    4241    /// Returns false as the Rosenbrock function is a minimization problem.
     
    7170
    7271    [StorableConstructor]
    73     protected RosenbrockEvaluator(bool deserializing) : base(deserializing) { }
    74     protected RosenbrockEvaluator(RosenbrockEvaluator original, Cloner cloner) : base(original, cloner) { }
    75     public RosenbrockEvaluator() : base() { }
     72    protected Rosenbrock(bool deserializing) : base(deserializing) { }
     73    protected Rosenbrock(Rosenbrock original, Cloner cloner) : base(original, cloner) { }
     74    public Rosenbrock() : base() { }
    7675
    7776    public override IDeepCloneable Clone(Cloner cloner) {
    78       return new RosenbrockEvaluator(this, cloner);
     77      return new Rosenbrock(this, cloner);
    7978    }
    8079
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Schwefel.cs

    r13393 r13403  
    3131  /// 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.
    3232  /// </summary>
    33   [Item("SchwefelEvaluator", "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.")]
    3434  [StorableClass]
    35   public class SchwefelEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    36     public override string FunctionName { get { return "Schwefel"; } }
     35  public class Schwefel : SingleObjectiveTestFunction {
    3736    /// <summary>
    3837    /// Returns false as the Schwefel (sine root) function is a minimization problem.
     
    6766
    6867    [StorableConstructor]
    69     protected SchwefelEvaluator(bool deserializing) : base(deserializing) { }
    70     protected SchwefelEvaluator(SchwefelEvaluator original, Cloner cloner) : base(original, cloner) { }
    71     public SchwefelEvaluator() : base() { }
     68    protected Schwefel(bool deserializing) : base(deserializing) { }
     69    protected Schwefel(Schwefel original, Cloner cloner) : base(original, cloner) { }
     70    public Schwefel() : base() { }
    7271
    7372    public override IDeepCloneable Clone(Cloner cloner) {
    74       return new SchwefelEvaluator(this, cloner);
     73      return new Schwefel(this, cloner);
    7574    }
    7675
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/SingleObjectiveTestFunction.cs

    r13393 r13403  
    2424using HeuristicLab.Data;
    2525using HeuristicLab.Encodings.RealVectorEncoding;
    26 using HeuristicLab.Operators;
    27 using HeuristicLab.Parameters;
    2826using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2927
     
    3230  /// Base class for a test function evaluator.
    3331  /// </summary>
    34   [Item("Evaluator", "Base calls for single objective test function evaluators.")]
     32  [Item("Single-Objective Function", "Base class for single objective functions.")]
    3533  [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 {
    4135    /// <summary>
    4236    /// These operators should not change their name through the GUI
     
    6660    public abstract int MaximumProblemSize { get; }
    6761
    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 
    7562    [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() { }
    9466
    9567    public virtual double Evaluate2D(double x, double y) {
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Sphere.cs

    r13393 r13403  
    3333  /// 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.
    3434  /// </summary>
    35   [Item("SphereEvaluator", "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.")]
    3636  [StorableClass]
    37   public class SphereEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    38     public override string FunctionName { get { return "Sphere"; } }
     37  public class Sphere : SingleObjectiveTestFunction {
    3938    /// <summary>
    4039    /// Returns false as the Sphere function is a minimization problem.
     
    6968
    7069    public override IDeepCloneable Clone(Cloner cloner) {
    71       return new SphereEvaluator(this, cloner);
     70      return new Sphere(this, cloner);
    7271    }
    7372
     
    104103
    105104    [StorableConstructor]
    106     protected SphereEvaluator(bool deserializing) : base(deserializing) { }
    107     protected SphereEvaluator(SphereEvaluator original, Cloner cloner) : base(original, cloner) { }
     105    protected Sphere(bool deserializing) : base(deserializing) { }
     106    protected Sphere(Sphere original, Cloner cloner) : base(original, cloner) { }
    108107    /// <summary>
    109108    /// Initializes a new instance of the SphereEvaluator with two parameters (<c>C</c> and <c>Alpha</c>).
    110109    /// </summary>
    111     public SphereEvaluator()
     110    public Sphere()
    112111      : base() {
    113112      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  
    3030  /// The Sum Squares function is defined as sum(i * x_i * x_i) for i = 1..n
    3131  /// </summary>
    32   [Item("SumSquaresEvaluator", "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.")]
    3333  [StorableClass]
    34   public class SumSquaresEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    35     public override string FunctionName { get { return "SumSquares"; } }
     34  public class SumSquares : SingleObjectiveTestFunction {
    3635    /// <summary>
    3736    /// Returns false as the Sum Squares function is a minimization problem.
     
    6665
    6766    [StorableConstructor]
    68     protected SumSquaresEvaluator(bool deserializing) : base(deserializing) { }
    69     protected SumSquaresEvaluator(SumSquaresEvaluator original, Cloner cloner) : base(original, cloner) { }
    70     public SumSquaresEvaluator() : base() { }
     67    protected SumSquares(bool deserializing) : base(deserializing) { }
     68    protected SumSquares(SumSquares original, Cloner cloner) : base(original, cloner) { }
     69    public SumSquares() : base() { }
    7170
    7271    public override IDeepCloneable Clone(Cloner cloner) {
    73       return new SumSquaresEvaluator(this, cloner);
     72      return new SumSquares(this, cloner);
    7473    }
    7574
  • branches/ProblemRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Functions/Zakharov.cs

    r13393 r13403  
    3030  /// 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.
    3131  /// </summary>
    32   [Item("ZakharovEvaluator", "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.")]
    3333  [StorableClass]
    34   public class ZakharovEvaluator : SingleObjectiveTestFunctionProblemEvaluator {
    35     public override string FunctionName { get { return "Zakharov"; } }
     34  public class Zakharov : SingleObjectiveTestFunction {
    3635    /// <summary>
    3736    /// Returns false as the Zakharov function is a minimization problem.
     
    7069
    7170    [StorableConstructor]
    72     protected ZakharovEvaluator(bool deserializing) : base(deserializing) { }
    73     protected ZakharovEvaluator(ZakharovEvaluator original, Cloner cloner) : base(original, cloner) { }
    74     public ZakharovEvaluator() : base() { }
     71    protected Zakharov(bool deserializing) : base(deserializing) { }
     72    protected Zakharov(Zakharov original, Cloner cloner) : base(original, cloner) { }
     73    public Zakharov() : base() { }
    7574
    7675    public override IDeepCloneable Clone(Cloner cloner) {
    77       return new ZakharovEvaluator(this, cloner);
     76      return new Zakharov(this, cloner);
    7877    }
    7978
Note: See TracChangeset for help on using the changeset viewer.