- Timestamp:
- 04/30/15 10:35:55 (10 years ago)
- 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 179 179 <Compile Include="Comparators\WeightedParentsQualityComparator.cs" /> 180 180 <Compile Include="ISubScopesQualityComparatorOperator.cs" /> 181 <Compile Include="LinearDiscreteReverseDoubleValueModifier.cs" /> 181 182 <Compile Include="OffspringCollector.cs" /> 182 183 <Compile Include="OffspringSelectors\IOffspringSelector.cs" /> -
branches/VOSGA/HeuristicLab.Algorithms.VOffspringSelectionGeneticAlgorithm/LinearDiscreteReverseDoubleValueModifier.cs
r12354 r12369 28 28 /// Modifies the value by linear (constant) fall or rise. 29 29 /// </summary> 30 [Item("LinearDiscrete DoubleValueModifier", "Modifies the value by linear (constant) fall or rise.")]30 [Item("LinearDiscreteReverseDoubleValueModifier", "Modifies the value by linear (constant) fall or rise.")] 31 31 [StorableClass] 32 public class LinearDiscrete DoubleValueModifier : DiscreteDoubleValueModifier {32 public class LinearDiscreteReverseDoubleValueModifier : DiscreteDoubleValueModifier { 33 33 [StorableConstructor] 34 protected LinearDiscrete DoubleValueModifier(bool deserializing) : base(deserializing) { }35 protected LinearDiscrete DoubleValueModifier(LinearDiscreteDoubleValueModifier original, Cloner cloner) : base(original, cloner) { }36 public LinearDiscrete DoubleValueModifier() : base() { }34 protected LinearDiscreteReverseDoubleValueModifier(bool deserializing) : base(deserializing) { } 35 protected LinearDiscreteReverseDoubleValueModifier(LinearDiscreteReverseDoubleValueModifier original, Cloner cloner) : base(original, cloner) { } 36 public LinearDiscreteReverseDoubleValueModifier() : base() { } 37 37 38 38 public override IDeepCloneable Clone(Cloner cloner) { 39 return new LinearDiscrete DoubleValueModifier(this, cloner);39 return new LinearDiscreteReverseDoubleValueModifier(this, cloner); 40 40 } 41 41 42 42 protected override double Modify(double value, double startValue, double endValue, int index, int startIndex, int endIndex) { 43 43 double k = (endValue - startValue) / (endIndex - startIndex); 44 double x = index - startIndex;44 double x = endIndex - index; 45 45 return k * x + startValue; 46 46 }
Note: See TracChangeset
for help on using the changeset viewer.