Changeset 17732 for stable/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs
- Timestamp:
- 08/27/20 12:59:27 (4 years ago)
- Location:
- stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk merged: 17729-17730
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs
r17181 r17732 42 42 43 43 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 44 return Apply(value, startValue, endValue, index, startIndex, endIndex); 45 } 46 47 /// <summary> 48 /// Calculates a new value based on sqrt decay or growth. 49 /// </summary> 50 /// <param name="value">The previous value.</param> 51 /// <param name="startValue">The initial value.</param> 52 /// <param name="endValue">The final value.</param> 53 /// <param name="index">The current index.</param> 54 /// <param name="startIndex">The initial index.</param> 55 /// <param name="endIndex">The final index.</param> 56 /// <returns>The new value.</returns> 57 public static double Apply(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 44 58 double a = (endValue - startValue) / Math.Sqrt(endIndex - startIndex); 45 59 return a * Math.Sqrt(index - startIndex) + startValue;
Note: See TracChangeset
for help on using the changeset viewer.