Changeset 17732 for stable/HeuristicLab.Optimization.Operators/3.3/LinearDiscreteDoubleValueModifier.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/LinearDiscreteDoubleValueModifier.cs
r17181 r17732 41 41 42 42 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 43 return Apply(value, startValue, endValue, index, startIndex, endIndex); 44 } 45 46 /// <summary> 47 /// Calculates a new value based on linear decay or growth. 48 /// </summary> 49 /// <param name="value">The previous value.</param> 50 /// <param name="startValue">The initial value.</param> 51 /// <param name="endValue">The final value.</param> 52 /// <param name="index">The current index.</param> 53 /// <param name="startIndex">The initial index.</param> 54 /// <param name="endIndex">The final index.</param> 55 /// <returns>The new value.</returns> 56 public static double Apply(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 43 57 double k = (endValue - startValue) / (endIndex - startIndex); 44 58 double x = index - startIndex;
Note: See TracChangeset
for help on using the changeset viewer.