Changeset 3706 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs
- Timestamp:
- 05/07/10 16:29:25 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticTranslocationSingleMoveGenerator.cs
r3376 r3706 31 31 [Item("StochasticTranslocationSingleMoveGenerator", "Randomly samples one from all possible translocation and insertion moves (3-opt) from a given permutation.")] 32 32 [StorableClass] 33 public class StochasticT hreeOptSingleMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, ISingleMoveGenerator {33 public class StochasticTranslocationSingleMoveGenerator : TranslocationMoveGenerator, IStochasticOperator, ISingleMoveGenerator { 34 34 public ILookupParameter<IRandom> RandomParameter { 35 35 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 36 36 } 37 37 38 public StochasticT hreeOptSingleMoveGenerator()38 public StochasticTranslocationSingleMoveGenerator() 39 39 : base() { 40 40 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); … … 43 43 public static TranslocationMove Apply(Permutation permutation, IRandom random) { 44 44 int length = permutation.Length; 45 if (length == 1) throw new ArgumentException("StochasticThreeOptSingleMoveGenerator: There cannot be an insertion move given a permutation of length 1.", "permutation"); 46 if (permutation.PermutationType != PermutationTypes.Absolute && length == 2) return new TranslocationMove(0, 0, 1); 45 47 int index1, index2, index3; 46 48 do {
Note: See TracChangeset
for help on using the changeset viewer.