Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/15 11:09:38 (10 years ago)
Author:
abeham
Message:

#2253:

  • Changed parameter from fixedvalue to valuelookup to be consistent with other operators in binary encoding plugin
  • Added backwards compatibility region
  • Fixed several other inconsistencies
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Manipulators/SomePositionsBitflipManipulator.cs

    r11171 r11909  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    3940    /// Mmutation probability for each position.
    4041    /// </summary>
    41     public ValueLookupParameter<DoubleValue> MutationProbabilityParameter {
    42       get { return (ValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }
     42    public IValueLookupParameter<DoubleValue> MutationProbabilityParameter {
     43      get { return (IValueLookupParameter<DoubleValue>)Parameters["MutationProbability"]; }
    4344    }
    4445
     
    7879    /// <param name="realVector">The vector of binary values to manipulate.</param>
    7980    protected override void Manipulate(IRandom random, BinaryVector binaryVector) {
    80       Apply(random, binaryVector, MutationProbabilityParameter.Value);
     81      if (MutationProbabilityParameter.ActualValue == null) throw new InvalidOperationException("SomePositionsBitflipManipulator: Parameter " + MutationProbabilityParameter.ActualName + " could not be found.");
     82      Apply(random, binaryVector, MutationProbabilityParameter.ActualValue);
    8183    }
    8284  }
Note: See TracChangeset for help on using the changeset viewer.