Changeset 3232 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs
- Timestamp:
- 03/29/10 18:49:55 (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationMultiMoveGenerator.cs
r3231 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("StochasticT hreeOptMultiMoveGenerator", "Randomly samples n from all possible 3-opt movesfrom a given permutation.")]30 [Item("StochasticTranslocationMultiMoveGenerator", "Randomly samples n from all possible translocation and insertion moves (3-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class StochasticT hreeOptMultiMoveGenerator : ThreeOptMoveGenerator, IStochasticOperator, IMultiMoveGenerator {32 public class StochasticTranslocationMultiMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, IMultiMoveGenerator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 43 43 } 44 44 45 public StochasticT hreeOptMultiMoveGenerator()45 public StochasticTranslocationMultiMoveGenerator() 46 46 : base() { 47 47 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); … … 49 49 } 50 50 51 public static T hreeOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {51 public static TranslocationMove[] Apply(Permutation permutation, IRandom random, int sampleSize) { 52 52 int length = permutation.Length; 53 T hreeOptMove[] moves = new ThreeOptMove[sampleSize];53 TranslocationMove[] moves = new TranslocationMove[sampleSize]; 54 54 for (int i = 0; i < sampleSize; i++) { 55 55 moves[i] = StochasticThreeOptSingleMoveGenerator.Apply(permutation, random); … … 58 58 } 59 59 60 protected override T hreeOptMove[] GenerateMoves(Permutation permutation) {60 protected override TranslocationMove[] GenerateMoves(Permutation permutation) { 61 61 IRandom random = RandomParameter.ActualValue; 62 62 return Apply(permutation, random, SampleSizeParameter.ActualValue.Value);
Note: See TracChangeset
for help on using the changeset viewer.