Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/29/10 20:26:45 (14 years ago)
Author:
swagner
Message:

Finished cloning refactoring of HeuristicLab.Problems.TestFunctions (#922)

Location:
branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/AckleyEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6566    }
    6667
     68    [StorableConstructor]
     69    protected AckleyEvaluator(bool deserializing) : base(deserializing) { }
     70    protected AckleyEvaluator(AckleyEvaluator original, Cloner cloner) : base(original, cloner) { }
     71    public AckleyEvaluator() : base() { }
     72
     73    public override IDeepCloneable Clone(Cloner cloner) {
     74      return new AckleyEvaluator(this, cloner);
     75    }
     76
    6777    public override RealVector GetBestKnownSolution(int dimension) {
    6878      return new RealVector(dimension);
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/BealeEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6566    }
    6667
     68    [StorableConstructor]
     69    protected BealeEvaluator(bool deserializing) : base(deserializing) { }
     70    protected BealeEvaluator(BealeEvaluator original, Cloner cloner) : base(original, cloner) { }
     71    public BealeEvaluator() : base() { }
     72
     73    public override IDeepCloneable Clone(Cloner cloner) {
     74      return new BealeEvaluator(this, cloner);
     75    }
     76
    6777    public override RealVector GetBestKnownSolution(int dimension) {
    6878      if (dimension != 2) throw new ArgumentException(Name + ": This function is only defined for 2 dimensions.", "dimension");
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/BoothEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6465    }
    6566
     67    [StorableConstructor]
     68    protected BoothEvaluator(bool deserializing) : base(deserializing) { }
     69    protected BoothEvaluator(BoothEvaluator original, Cloner cloner) : base(original, cloner) { }
     70    public BoothEvaluator() : base() { }
     71
     72    public override IDeepCloneable Clone(Cloner cloner) {
     73      return new BoothEvaluator(this, cloner);
     74    }
     75
    6676    public override RealVector GetBestKnownSolution(int dimension) {
    6777      if (dimension != 2) throw new ArgumentException(Name + ": This function is only defined for 2 dimensions.", "dimension");
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/GriewankEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6465    public override int MaximumProblemSize {
    6566      get { return int.MaxValue; }
     67    }
     68
     69    [StorableConstructor]
     70    protected GriewankEvaluator(bool deserializing) : base(deserializing) { }
     71    protected GriewankEvaluator(GriewankEvaluator original, Cloner cloner) : base(original, cloner) { }
     72    public GriewankEvaluator() : base() { }
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new GriewankEvaluator(this, cloner);
    6676    }
    6777
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/LevyEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6263    public override int MaximumProblemSize {
    6364      get { return int.MaxValue; }
     65    }
     66
     67    [StorableConstructor]
     68    protected LevyEvaluator(bool deserializing) : base(deserializing) { }
     69    protected LevyEvaluator(LevyEvaluator original, Cloner cloner) : base(original, cloner) { }
     70    public LevyEvaluator() : base() { }
     71
     72    public override IDeepCloneable Clone(Cloner cloner) {
     73      return new LevyEvaluator(this, cloner);
    6474    }
    6575
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/MatyasEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6465    }
    6566
     67    [StorableConstructor]
     68    protected MatyasEvaluator(bool deserializing) : base(deserializing) { }
     69    protected MatyasEvaluator(MatyasEvaluator original, Cloner cloner) : base(original, cloner) { }
     70    public MatyasEvaluator() : base() { }
     71
     72    public override IDeepCloneable Clone(Cloner cloner) {
     73      return new MatyasEvaluator(this, cloner);
     74    }
     75
    6676    public override RealVector GetBestKnownSolution(int dimension) {
    6777      if (dimension != 2) throw new ArgumentException(Name + ": This function is only defined for 2 dimensions.", "dimension");
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/MultinormalEvaluator.cs

    r4068 r4688  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System;
    223using System.Collections.Generic;
    324using System.Diagnostics;
    425using System.Linq;
     26using HeuristicLab.Common;
    527using HeuristicLab.Core;
    628using HeuristicLab.Data;
     
    2345    }
    2446    private static Random Random = new Random();
    25 
    26     [StorableConstructor]
    27     public MultinormalEvaluator(bool deserializing) { }
    2847
    2948    private Dictionary<int, List<RealVector>> stdCenters;
     
    6685    }
    6786
     87    [StorableConstructor]
     88    protected MultinormalEvaluator(bool deserializing) : base(deserializing) { }
     89    protected MultinormalEvaluator(MultinormalEvaluator original, Cloner cloner) : base(original, cloner) { }
    6890    public MultinormalEvaluator() {
    6991      Parameters.Add(new ValueParameter<ItemList<RealVector>>("Centers", "Centers of normal distributions"));
     
    7294      centers = new ItemList<RealVector>();
    7395      s_2s = new RealVector();
     96    }
     97
     98    public override IDeepCloneable Clone(Cloner cloner) {
     99      return new MultinormalEvaluator(this, cloner);
    74100    }
    75101
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/RastriginEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    8384    }
    8485
     86    [StorableConstructor]
     87    protected RastriginEvaluator(bool deserializing) : base(deserializing) { }
     88    protected RastriginEvaluator(RastriginEvaluator original, Cloner cloner) : base(original, cloner) { }
    8589    /// <summary>
    8690    /// Initializes a new instance of the RastriginEvaluator with one parameter (<c>A</c>).
     
    8993      : base() {
    9094      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)));
     95    }
     96
     97    public override IDeepCloneable Clone(Cloner cloner) {
     98      return new RastriginEvaluator(this, cloner);
    9199    }
    92100
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/RosenbrockEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6869    }
    6970
     71    [StorableConstructor]
     72    protected RosenbrockEvaluator(bool deserializing) : base(deserializing) { }
     73    protected RosenbrockEvaluator(RosenbrockEvaluator original, Cloner cloner) : base(original, cloner) { }
     74    public RosenbrockEvaluator() : base() { }
     75
     76    public override IDeepCloneable Clone(Cloner cloner) {
     77      return new RosenbrockEvaluator(this, cloner);
     78    }
     79
    7080    public override RealVector GetBestKnownSolution(int dimension) {
    7181      if (dimension < 2) throw new ArgumentException(Name + ": This function is not defined for 1 dimension.");
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/SchwefelEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6465    }
    6566
     67    [StorableConstructor]
     68    protected SchwefelEvaluator(bool deserializing) : base(deserializing) { }
     69    protected SchwefelEvaluator(SchwefelEvaluator original, Cloner cloner) : base(original, cloner) { }
     70    public SchwefelEvaluator() : base() { }
     71
     72    public override IDeepCloneable Clone(Cloner cloner) {
     73      return new SchwefelEvaluator(this, cloner);
     74    }
     75
    6676    public override RealVector GetBestKnownSolution(int dimension) {
    6777      return null;
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/SingleObjectiveTestFunctionProblemEvaluator.cs

    r4068 r4688  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6768      get { return (ILookupParameter<RealVector>)Parameters["Point"]; }
    6869    }
     70
     71    [StorableConstructor]
     72    protected SingleObjectiveTestFunctionProblemEvaluator(bool deserializing) : base(deserializing) { }
     73    protected SingleObjectiveTestFunctionProblemEvaluator(SingleObjectiveTestFunctionProblemEvaluator original, Cloner cloner) : base(original, cloner) { }
    6974    /// <summary>
    7075    /// Initializes a new instance of <see cref="SingleObjectiveTestFunctionEvaluator"/> with two parameters
    7176    /// (<c>Quality</c> and <c>Point</c>).
    7277    /// </summary>
    73     public SingleObjectiveTestFunctionProblemEvaluator() {
     78    public SingleObjectiveTestFunctionProblemEvaluator()
     79      : base() {
    7480      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "Result of the evaluation of a solution."));
    7581      Parameters.Add(new LookupParameter<RealVector>("Point", "The point at which the function should be evaluated."));
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/SphereEvaluator.cs

    r4068 r4688  
    2121
    2222using System;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6667    }
    6768
     69    public override IDeepCloneable Clone(Cloner cloner) {
     70      return new SphereEvaluator(this, cloner);
     71    }
     72
    6873    public override RealVector GetBestKnownSolution(int dimension) {
    6974      return new RealVector(dimension);
     
    97102    }
    98103
     104    [StorableConstructor]
     105    protected SphereEvaluator(bool deserializing) : base(deserializing) { }
     106    protected SphereEvaluator(SphereEvaluator original, Cloner cloner) : base(original, cloner) { }
    99107    /// <summary>
    100108    /// Initializes a new instance of the SphereEvaluator with two parameters (<c>C</c> and <c>Alpha</c>).
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/SumSquaresEvaluator.cs

    r4068 r4688  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6364    }
    6465
     66    [StorableConstructor]
     67    protected SumSquaresEvaluator(bool deserializing) : base(deserializing) { }
     68    protected SumSquaresEvaluator(SumSquaresEvaluator original, Cloner cloner) : base(original, cloner) { }
     69    public SumSquaresEvaluator() : base() { }
     70
     71    public override IDeepCloneable Clone(Cloner cloner) {
     72      return new SumSquaresEvaluator(this, cloner);
     73    }
     74
    6575    public override RealVector GetBestKnownSolution(int dimension) {
    6676      return new RealVector(dimension);
  • branches/CloningRefactoring/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/ZakharovEvaluator.cs

    r4068 r4688  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    6768    }
    6869
     70    [StorableConstructor]
     71    protected ZakharovEvaluator(bool deserializing) : base(deserializing) { }
     72    protected ZakharovEvaluator(ZakharovEvaluator original, Cloner cloner) : base(original, cloner) { }
     73    public ZakharovEvaluator() : base() { }
     74
     75    public override IDeepCloneable Clone(Cloner cloner) {
     76      return new ZakharovEvaluator(this, cloner);
     77    }
     78
    6979    /// <summary>
    7080    /// Evaluates the test function for a specific <paramref name="point"/>.
Note: See TracChangeset for help on using the changeset viewer.