Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/13/10 09:47:06 (14 years ago)
Author:
abeham
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/MoveEvaluators/SphereAdditiveMoveEvaluator.cs

    r3315 r3318  
    2121
    2222using HeuristicLab.Core;
     23using HeuristicLab.Data;
     24using HeuristicLab.Encodings.RealVectorEncoding;
     25using HeuristicLab.Parameters;
    2326using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    24 using HeuristicLab.Encodings.RealVectorEncoding;
    2527
    2628namespace HeuristicLab.Problems.TestFunctions {
    2729  [Item("SphereAdditiveMoveEvaluator", "Class for evaluating an additive move on the Sphere function.")]
    2830  [StorableClass]
    29   public class SphereAdditiveMoveEvaluator : AdditiveMoveEvaluator {
     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
    3059    public override System.Type EvaluatorType {
    3160      get { return typeof(SphereEvaluator); }
     
    3362    protected override double Evaluate(double quality, RealVector point, AdditiveMove move) {
    3463      RealVectorAdditiveMoveWrapper wrapper = new RealVectorAdditiveMoveWrapper(move, point);
    35       return SphereEvaluator.Apply(wrapper, 1, 2); // FIXME: the parameters have to be wired.
     64      return SphereEvaluator.Apply(wrapper, C.Value, Alpha.Value);
    3665    }
    3766  }
Note: See TracChangeset for help on using the changeset viewer.