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/Moves/OneBitflipMove/StochasticOneBitflipMultiMoveGenerator.cs

    r11171 r11909  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    3031  [Item("StochasticOneBitflipMultiMoveGenerator", "Randomly samples n from all possible one bitflip moves from a given BinaryVector.")]
    3132  [StorableClass]
    32   public class StochasticOneBitflipMultiMoveGenerator : OneBitflipMoveGenerator, IMultiMoveGenerator {
     33  public class StochasticOneBitflipMultiMoveGenerator : OneBitflipMoveGenerator, IStochasticOperator, IMultiMoveGenerator {
    3334    public ILookupParameter<IRandom> RandomParameter {
    3435      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     
    6667    protected override OneBitflipMove[] GenerateMoves(BinaryVector binaryVector) {
    6768      IRandom random = RandomParameter.ActualValue;
     69      if (SampleSizeParameter.ActualValue == null) throw new InvalidOperationException("StochasticOneBitflipMultiMoveGenerator: Parameter " + SampleSizeParameter.ActualName + " could not be found.");
    6870      return Apply(binaryVector, random, SampleSizeParameter.ActualValue.Value);
    6971    }
Note: See TracChangeset for help on using the changeset viewer.