Changeset 17825 for branches/3040_VectorBasedGP/HeuristicLab.Optimization.Operators/3.3/QuadraticDiscreteDoubleValueModifier.cs
- Timestamp:
- 01/27/21 14:10:56 (4 years ago)
- Location:
- branches/3040_VectorBasedGP
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Optimization.Operators/3.3/QuadraticDiscreteDoubleValueModifier.cs
r17180 r17825 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 quadratic 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 a = (endValue - startValue) / ((endIndex - startIndex) * (endIndex - startIndex)); 44 58 return a * (index - startIndex) * (index - startIndex) + startValue;
Note: See TracChangeset
for help on using the changeset viewer.