Changeset 3221 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMultiMoveGenerator.cs
- Timestamp:
- 03/26/10 00:04:24 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMultiMoveGenerator.cs
r3101 r3221 28 28 29 29 namespace 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.")] 31 31 [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 } 33 36 public IValueLookupParameter<IntValue> SampleSizeParameter { 34 37 get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; } … … 42 45 public StochasticTwoOptMultiMoveGenerator() 43 46 : base() { 47 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 44 48 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate.")); 45 49 } … … 49 53 TwoOptMove[] moves = new TwoOptMove[sampleSize]; 50 54 for (int i = 0; i < sampleSize; i++) { 51 moves[i] = Apply(permutation, random);55 moves[i] = StochasticTwoOptSingleMoveGenerator.Apply(permutation, random); 52 56 } 53 57 return moves;
Note: See TracChangeset
for help on using the changeset viewer.