Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/26/10 00:04:24 (14 years ago)
Author:
abeham
Message:

updated permutation moves, fixed 3-opt #889

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMultiMoveGenerator.cs

    r3101 r3221  
    2828
    2929namespace HeuristicLab.Encodings.PermutationEncoding {
    30   [Item("StochasticTwoOptMultiMoveGenerator", "Randomly samples n from all possible 2-opt moves from a given permutation.")]
     30  [Item("StochasticTwoOptMultiMoveGenerator", "Randomly samples n from all possible 2-opt moves (inversion) from a given permutation.")]
    3131  [StorableClass]
    32   public class StochasticTwoOptMultiMoveGenerator : StochasticTwoOptSingleMoveGenerator, IMultiMoveGenerator {
     32  public class StochasticTwoOptMultiMoveGenerator : TwoOptMoveGenerator, IMultiMoveGenerator, IStochasticOperator {
     33    public ILookupParameter<IRandom> RandomParameter {
     34      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     35    }
    3336    public IValueLookupParameter<IntValue> SampleSizeParameter {
    3437      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
     
    4245    public StochasticTwoOptMultiMoveGenerator()
    4346      : base() {
     47      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
    4448      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
    4549    }
     
    4953      TwoOptMove[] moves = new TwoOptMove[sampleSize];
    5054      for (int i = 0; i < sampleSize; i++) {
    51         moves[i] = Apply(permutation, random);
     55        moves[i] = StochasticTwoOptSingleMoveGenerator.Apply(permutation, random);
    5256      }
    5357      return moves;
Note: See TracChangeset for help on using the changeset viewer.