Free cookie consent management tool by TermsFeed Policy Generator

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

#2267 added a value modifier

Location:
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm-3.3.csproj

    r12363 r12369  
    179179    <Compile Include="Comparators\WeightedParentsQualityComparator.cs" />
    180180    <Compile Include="ISubScopesQualityComparatorOperator.cs" />
     181    <Compile Include="LinearDiscreteReverseDoubleValueModifier.cs" />
    181182    <Compile Include="OffspringCollector.cs" />
    182183    <Compile Include="OffspringSelectors\IOffspringSelector.cs" />
  • 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.