Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/MoveEvaluators/SphereAdditiveMoveEvaluator.cs @ 3318

Last change on this file since 3318 was 3318, checked in by abeham, 14 years ago

Updated test functions, added reference for Zakharov
Did not find a reference for SumSquares, just described it
Added wiring for rastrigin and sphere
#934

File size: 2.8 KB
Line 
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 HeuristicLab.Core;
23using HeuristicLab.Data;
24using HeuristicLab.Encodings.RealVectorEncoding;
25using HeuristicLab.Parameters;
26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
27
28namespace HeuristicLab.Problems.TestFunctions {
29  [Item("SphereAdditiveMoveEvaluator", "Class for evaluating an additive move on the Sphere function.")]
30  [StorableClass]
31  public class SphereAdditiveMoveEvaluator : AdditiveMoveEvaluator, ISphereMoveEvaluator {
32    /// <summary>
33    /// The parameter C modifies the steepness of the objective function y = C * ||X||^Alpha. Default is C = 1.
34    /// </summary>
35    public ValueParameter<DoubleValue> CParameter {
36      get { return (ValueParameter<DoubleValue>)Parameters["C"]; }
37    }
38    /// <summary>
39    /// The parameter Alpha modifies the steepness of the objective function y = C * ||X||^Alpha. Default is Alpha = 2.
40    /// </summary>
41    public ValueParameter<DoubleValue> AlphaParameter {
42      get { return (ValueParameter<DoubleValue>)Parameters["Alpha"]; }
43    }
44    /// <summary>
45    /// The parameter C modifies the steepness of the objective function y = C * ||X||^Alpha. Default is C = 1.
46    /// </summary>
47    public DoubleValue C {
48      get { return CParameter.Value; }
49      set { if (value != null) CParameter.Value = value; }
50    }
51    /// <summary>
52    /// The parameter Alpha modifies the steepness of the objective function y = C * ||X||^Alpha. Default is Alpha = 2.
53    /// </summary>
54    public DoubleValue Alpha {
55      get { return AlphaParameter.Value; }
56      set { if (value != null) AlphaParameter.Value = value; }
57    }
58
59    public override System.Type EvaluatorType {
60      get { return typeof(SphereEvaluator); }
61    }
62    protected override double Evaluate(double quality, RealVector point, AdditiveMove move) {
63      RealVectorAdditiveMoveWrapper wrapper = new RealVectorAdditiveMoveWrapper(move, point);
64      return SphereEvaluator.Apply(wrapper, C.Value, Alpha.Value);
65    }
66  }
67}
Note: See TracBrowser for help on using the repository browser.