Changeset 3318 for trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/MoveEvaluators/SphereAdditiveMoveEvaluator.cs
- Timestamp:
- 04/13/10 09:47:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/MoveEvaluators/SphereAdditiveMoveEvaluator.cs
r3315 r3318 21 21 22 22 using HeuristicLab.Core; 23 using HeuristicLab.Data; 24 using HeuristicLab.Encodings.RealVectorEncoding; 25 using HeuristicLab.Parameters; 23 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 24 using HeuristicLab.Encodings.RealVectorEncoding;25 27 26 28 namespace HeuristicLab.Problems.TestFunctions { 27 29 [Item("SphereAdditiveMoveEvaluator", "Class for evaluating an additive move on the Sphere function.")] 28 30 [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 30 59 public override System.Type EvaluatorType { 31 60 get { return typeof(SphereEvaluator); } … … 33 62 protected override double Evaluate(double quality, RealVector point, AdditiveMove move) { 34 63 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); 36 65 } 37 66 }
Note: See TracChangeset
for help on using the changeset viewer.