- Timestamp:
- 03/16/10 21:29:10 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves
- Files:
-
- 8 added
- 3 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMoveGenerator.cs
r3053 r3074 38 38 } 39 39 40 public IntValue SampleSize { 41 get { return SampleSizeParameter.Value; } 42 set { SampleSizeParameter.Value = value; } 43 } 44 40 45 public StochasticTwoOptMoveGenerator() 41 46 : base() { … … 50 55 TwoOptMove[] moves = new TwoOptMove[sampleSize]; 51 56 for (int i = 0; i < sampleSize; i++) { 52 int index1 = random.Next(length - 1); 53 int index2 = random.Next(index1 + 1, length); 57 int index1 = random.Next(length - 1), index2; 58 if (index1 >= 2) 59 index2 = random.Next(index1 + 1, length); 60 else index2 = random.Next(index1 + 1, length - (2 - index1)); 54 61 moves[i] = new TwoOptMove(index1, index2); 55 62 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/TwoOptMoveGenerator.cs
r3053 r3074 35 35 } 36 36 public ILookupParameter<TwoOptMove> TwoOptMoveParameter { 37 get { return (LookupParameter<TwoOptMove>)Parameters[" Move"]; }37 get { return (LookupParameter<TwoOptMove>)Parameters["TwoOptMove"]; } 38 38 } 39 39 protected ScopeParameter CurrentScopeParameter { … … 44 44 : base() { 45 45 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The permutation for which moves should be generated.")); 46 Parameters.Add(new LookupParameter<TwoOptMove>(" Move", "The moves that should be generated in subscopes."));46 Parameters.Add(new LookupParameter<TwoOptMove>("TwoOptMove", "The moves that should be generated in subscopes.")); 47 47 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes.")); 48 48 } … … 61 61 62 62 protected abstract TwoOptMove[] GenerateMoves(Permutation permutation); 63 64 public override bool CanChangeName { 65 get { return false; } 66 } 63 67 } 64 68 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/TwoOptMoveMaker.cs
r3053 r3074 33 33 public class TwoOptMoveMaker : SingleSuccessorOperator, ITwoOptPermutationMoveOperator, IMoveMaker { 34 34 public ILookupParameter<DoubleValue> QualityParameter { 35 get { return ( LookupParameter<DoubleValue>)Parameters["Quality"]; }35 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } 36 36 } 37 37 public ILookupParameter<DoubleValue> MoveQualityParameter { 38 get { return ( LookupParameter<DoubleValue>)Parameters["MoveQuality"]; }38 get { return (ILookupParameter<DoubleValue>)Parameters["MoveQuality"]; } 39 39 } 40 40 public ILookupParameter<TwoOptMove> TwoOptMoveParameter { 41 get { return ( LookupParameter<TwoOptMove>)Parameters["Move"]; }41 get { return (ILookupParameter<TwoOptMove>)Parameters["TwoOptMove"]; } 42 42 } 43 43 public ILookupParameter<Permutation> PermutationParameter { … … 48 48 : base() { 49 49 Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality of the solution.")); 50 Parameters.Add(new LookupParameter<TwoOptMove>(" Move", "The move to evaluate."));50 Parameters.Add(new LookupParameter<TwoOptMove>("TwoOptMove", "The move to evaluate.")); 51 51 Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The relative quality of the move.")); 52 52 Parameters.Add(new LookupParameter<Permutation>("Permutation", "The solution as permutation.")); … … 64 64 return base.Apply(); 65 65 } 66 67 public override bool CanChangeName { 68 get { return false; } 69 } 66 70 } 67 71 }
Note: See TracChangeset
for help on using the changeset viewer.