Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/27/20 12:59:27 (4 years ago)
Author:
dpiringe
Message:

#3081: merged r17729:r17730 into stable

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimization.Operators/3.3/SquareRootDiscreteDoubleValueModifier.cs

    r17181 r17732  
    4242
    4343    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) {
    4458      double a = (endValue - startValue) / Math.Sqrt(endIndex - startIndex);
    4559      return a * Math.Sqrt(index - startIndex) + startValue;
Note: See TracChangeset for help on using the changeset viewer.