Changeset 17928 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs
- Timestamp:
- 04/06/21 13:13:32 (4 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace
- Property svn:mergeinfo changed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs
r17180 r17928 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.