1  #region License Information


2  /* HeuristicLab


3  * Copyright (C) 20022015 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 


22  using System;


23  using HeuristicLab.Common;


24  using HeuristicLab.Core;


25  using HeuristicLab.Data;


26  using HeuristicLab.Encodings.RealVectorEncoding;


27  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;


28 


29  namespace HeuristicLab.Problems.TestFunctions {


30  /// <summary>


31  /// Base class for a test function evaluator.


32  /// </summary>


33  [Item("SingleObjective Function", "Base class for single objective functions.")]


34  [StorableClass]


35  public abstract class MultiObjectiveTestFunction : ParameterizedNamedItem, IMultiObjectiveTestFunction {


36  /// <summary>


37  /// These operators should not change their name through the GUI


38  /// </summary>


39  public override bool CanChangeName {


40  get { return false; }


41  }


42  /// <summary>


43  /// Returns whether the actual function constitutes a maximization or minimization problem.


44  /// </summary>


45  public abstract bool[] Maximization { get; }


46  /// <summary>


47  /// Gets the lower and upper bound of the function.


48  /// </summary>


49  public abstract DoubleMatrix Bounds { get; }


50  /// <summary>


51  /// Gets the minimum problem size.


52  /// </summary>


53  public abstract int MinimumProblemSize { get; }


54  /// <summary>


55  /// Gets the maximum problem size.


56  /// </summary>


57  public abstract int MaximumProblemSize { get; }


58  /// <summary>


59  /// Gets the minimum problem size.


60  /// </summary>


61  public abstract int MinimumSolutionSize { get; }


62  /// <summary>


63  /// Gets the maximum problem size.


64  /// </summary>


65  public abstract int MaximumSolutionSize { get; }


66 


67  [StorableConstructor]


68  protected MultiObjectiveTestFunction(bool deserializing) : base(deserializing) { }


69  protected MultiObjectiveTestFunction(MultiObjectiveTestFunction original, Cloner cloner) : base(original, cloner) { }


70  protected MultiObjectiveTestFunction() : base() { }


71 


72 


73  /// <summary>


74  /// Evaluates the test function for a specific <paramref name="point"/>.


75  /// </summary>


76  /// <param name="point">Ndimensional point for which the test function should be evaluated.</param>


77  /// <returns>The result values of the function at the given point.</returns>


78  public abstract double[] Evaluate(RealVector point);


79 


80  }


81  }

