Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/30/15 10:35:55 (9 years ago)
Author:
ascheibe
Message:

#2267 added a value modifier

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/LinearDiscreteReverseDoubleValueModifier.cs

    r12354 r12369  
    2828  /// Modifies the value by linear (constant) fall or rise.
    2929  /// </summary>
    30   [Item("LinearDiscreteDoubleValueModifier", "Modifies the value by linear (constant) fall or rise.")]
     30  [Item("LinearDiscreteReverseDoubleValueModifier", "Modifies the value by linear (constant) fall or rise.")]
    3131  [StorableClass]
    32   public class LinearDiscreteDoubleValueModifier : DiscreteDoubleValueModifier {
     32  public class LinearDiscreteReverseDoubleValueModifier : DiscreteDoubleValueModifier {
    3333    [StorableConstructor]
    34     protected LinearDiscreteDoubleValueModifier(bool deserializing) : base(deserializing) { }
    35     protected LinearDiscreteDoubleValueModifier(LinearDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { }
    36     public LinearDiscreteDoubleValueModifier() : base() { }
     34    protected LinearDiscreteReverseDoubleValueModifier(bool deserializing) : base(deserializing) { }
     35    protected LinearDiscreteReverseDoubleValueModifier(LinearDiscreteReverseDoubleValueModifier original, Cloner cloner) : base(original, cloner) { }
     36    public LinearDiscreteReverseDoubleValueModifier() : base() { }
    3737
    3838    public override IDeepCloneable Clone(Cloner cloner) {
    39       return new LinearDiscreteDoubleValueModifier(this, cloner);
     39      return new LinearDiscreteReverseDoubleValueModifier(this, cloner);
    4040    }
    4141
    4242    protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) {
    4343      double k = (endValue - startValue) / (endIndex - startIndex);
    44       double x = index - startIndex;
     44      double x = endIndex - index;
    4545      return k * x + startValue;
    4646    }
Note: See TracChangeset for help on using the changeset viewer.