Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/10 02:03:30 (15 years ago)
Author:
abeham
Message:

Completed main loop of simulated annealing
Added a ProbabilisticQualityComparator (derived from QualityComparator)
Added an exception in ExponentialDiscreteDoubleValueModifier when startValue, endValue, or both are <= 0.
#923

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/ExponentialDiscreteDoubleValueModifier.cs

    r3093 r3094  
    3131  [StorableClass]
    3232  public class ExponentialDiscreteDoubleValueModifier : DiscreteDoubleValueModifier {
     33    /// <summary>
     34    /// Calculates a new value based on exponential decay or growth.
     35    /// </summary>
     36    /// <exception cref="ArgumentException">Thrown when endValue or startValue or both are 0.</exception>
     37    /// <param name="value">The last value.</param>
     38    /// <param name="startValue">The start value.</param>
     39    /// <param name="endValue">The end value.</param>
     40    /// <param name="index">The current index.</param>
     41    /// <param name="startIndex">The start index.</param>
     42    /// <param name="endIndex">The end index.</param>
     43    /// <returns>The new value.</returns>
    3344    protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) {
     45      if (endValue <= 0 || startValue <= 0) throw new ArgumentException("ExponentialDiscreteDoubleValueModifier: startValue and endValue must be greater than 0.");
    3446      double b = Math.Pow(endValue / startValue, 1.0 / (endIndex - startIndex));
    3547      return startValue * Math.Pow(b, index - startIndex);
Note: See TracChangeset for help on using the changeset viewer.