Changeset 3233 for trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs
- Timestamp:
- 03/30/10 14:52:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticInversionSingleMoveGenerator.cs
r3232 r3233 44 44 int index1 = random.Next(length - 1); 45 45 int index2 = random.Next(index1 + 1, length); 46 return new InversionMove(index1, index2);; 46 if (permutation.PermutationType == PermutationTypes.RelativeUndirected) { 47 while (index2 - index1 >= length - 2) 48 index2 = random.Next(index1 + 1, length); 49 } 50 return new InversionMove(index1, index2); 47 51 } 48 52
Note: See TracChangeset
for help on using the changeset viewer.