- Timestamp:
- 03/26/10 00:04:24 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt
- Files:
-
- 8 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/StochasticThreeOptMultiMoveGenerator.cs
r3209 r3221 53 53 ThreeOptMove[] moves = new ThreeOptMove[sampleSize]; 54 54 for (int i = 0; i < sampleSize; i++) { 55 int index1, index2, index3; 56 index1 = random.Next(length - 1); 57 do { 58 index2 = random.Next(index1, length); 59 } while (index2 - index1 >= length - 2); 60 do { 61 index3 = random.Next(length - index2 + index1 - 1); 62 } while (index3 == index1); 63 64 moves[i] = new ThreeOptMove(index1, index2, index3); 55 moves[i] = StochasticThreeOptSingleMoveGenerator.Apply(permutation, random); 65 56 } 66 57 return moves; -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ThreeOptMoveGenerator.cs
r3074 r3221 31 31 [StorableClass] 32 32 public abstract class ThreeOptMoveGenerator : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveGenerator { 33 public override bool CanChangeName { 34 get { return false; } 35 } 33 36 public ILookupParameter<Permutation> PermutationParameter { 34 37 get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } 35 38 } 36 39 public ILookupParameter<ThreeOptMove> ThreeOptMoveParameter { 37 get { return (LookupParameter<ThreeOptMove>)Parameters[" Move"]; }40 get { return (LookupParameter<ThreeOptMove>)Parameters["ThreeOptMove"]; } 38 41 } 39 42 protected ScopeParameter CurrentScopeParameter { … … 44 47 : base() { 45 48 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated.")); 46 Parameters.Add(new LookupParameter<ThreeOptMove>(" Move", "The moves that should be generated in subscopes."));49 Parameters.Add(new LookupParameter<ThreeOptMove>("ThreeOptMove", "The moves that should be generated in subscopes.")); 47 50 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes.")); 48 51 } … … 61 64 62 65 protected abstract ThreeOptMove[] GenerateMoves(Permutation permutation); 63 64 public override bool CanChangeName {65 get { return false; }66 }67 66 } 68 67 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/ThreeOpt/ThreeOptMoveMaker.cs
r3200 r3221 32 32 [StorableClass] 33 33 public class ThreeOptMoveMaker : SingleSuccessorOperator, IThreeOptPermutationMoveOperator, IMoveMaker { 34 public override bool CanChangeName { 35 get { return false; } 36 } 34 37 public ILookupParameter<DoubleValue> QualityParameter { 35 38 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } … … 64 67 return base.Apply(); 65 68 } 66 67 public override bool CanChangeName {68 get { return false; }69 }70 69 } 71 70 }
Note: See TracChangeset
for help on using the changeset viewer.