- Timestamp:
- 06/17/11 15:22:27 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/FullTreeShaker.cs
r5809 r6439 32 32 private const string ShakingFactorParameterName = "ShakingFactor"; 33 33 #region parameter properties 34 public IValue LookupParameter<DoubleValue> ShakingFactorParameter {35 get { return (IValue LookupParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; }34 public IValueParameter<DoubleValue> ShakingFactorParameter { 35 get { return (IValueParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; } 36 36 } 37 37 #endregion 38 38 #region properties 39 public DoubleValue ShakingFactor { 40 get { return ShakingFactorParameter.ActualValue; } 39 public double ShakingFactor { 40 get { return ShakingFactorParameter.Value.Value; } 41 set { ShakingFactorParameter.Value.Value = value; } 41 42 } 42 43 #endregion 43 44 44 [StorableConstructor] 45 45 private FullTreeShaker(bool deserializing) : base(deserializing) { } … … 47 47 public FullTreeShaker() 48 48 : base() { 49 Parameters.Add(new ValueLookupParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));49 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0))); 50 50 } 51 51 … … 57 57 tree.Root.ForEachNodePostfix(node => { 58 58 if (node.HasLocalParameters) { 59 node.ShakeLocalParameters(random, ShakingFactor .Value);59 node.ShakeLocalParameters(random, ShakingFactor); 60 60 } 61 61 }); -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/OnePointShaker.cs
r5809 r6439 34 34 private const string ShakingFactorParameterName = "ShakingFactor"; 35 35 #region parameter properties 36 public IValue LookupParameter<DoubleValue> ShakingFactorParameter {37 get { return (IValue LookupParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; }36 public IValueParameter<DoubleValue> ShakingFactorParameter { 37 get { return (IValueParameter<DoubleValue>)Parameters[ShakingFactorParameterName]; } 38 38 } 39 39 #endregion 40 40 #region properties 41 public DoubleValue ShakingFactor { 42 get { return ShakingFactorParameter.ActualValue; } 41 public double ShakingFactor { 42 get { return ShakingFactorParameter.Value.Value; } 43 set { ShakingFactorParameter.Value.Value = value; } 43 44 } 44 45 #endregion … … 48 49 public OnePointShaker() 49 50 : base() { 50 Parameters.Add(new ValueLookupParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0)));51 Parameters.Add(new FixedValueParameter<DoubleValue>(ShakingFactorParameterName, "The shaking factor that should be used for the manipulation of constants (default=1.0).", new DoubleValue(1.0))); 51 52 } 52 53 … … 62 63 if (parametricNodes.Count > 0) { 63 64 var selectedPoint = parametricNodes.SelectRandom(random); 64 selectedPoint.ShakeLocalParameters(random, ShakingFactor .Value);65 selectedPoint.ShakeLocalParameters(random, ShakingFactor); 65 66 } 66 67 }
Note: See TracChangeset
for help on using the changeset viewer.