Changeset 3232 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.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/StochasticTranslocationSingleMoveGenerator.cs
r3231 r3232 28 28 29 29 namespace HeuristicLab.Encodings.PermutationEncoding { 30 [Item("StochasticT hreeOptSingleMoveGenerator", "Randomly samples one from all possible 3-opt movesfrom a given permutation.")]30 [Item("StochasticTranslocationSingleMoveGenerator", "Randomly samples one from all possible translocation and insertion moves (3-opt) from a given permutation.")] 31 31 [StorableClass] 32 public class StochasticThreeOptSingleMoveGenerator : T hreeOptMoveGenerator, IStochasticOperator, ISingleMoveGenerator {32 public class StochasticThreeOptSingleMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, ISingleMoveGenerator { 33 33 public ILookupParameter<IRandom> RandomParameter { 34 34 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 40 40 } 41 41 42 public static T hreeOptMove Apply(Permutation permutation, IRandom random) {42 public static TranslocationMove Apply(Permutation permutation, IRandom random) { 43 43 int length = permutation.Length; 44 44 int index1, index2, index3; … … 51 51 } while (index3 == index1); 52 52 53 return new T hreeOptMove(index1, index2, index3);53 return new TranslocationMove(index1, index2, index3); 54 54 } 55 55 56 protected override T hreeOptMove[] GenerateMoves(Permutation permutation) {56 protected override TranslocationMove[] GenerateMoves(Permutation permutation) { 57 57 IRandom random = RandomParameter.ActualValue; 58 return new T hreeOptMove[] { Apply(permutation, random) };58 return new TranslocationMove[] { Apply(permutation, random) }; 59 59 } 60 60 }
Note: See TracChangeset
for help on using the changeset viewer.