- Timestamp:
- 03/18/10 20:56:34 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMultiMoveGenerator.cs
r3098 r3101 47 47 public static TwoOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) { 48 48 int length = permutation.Length; 49 int totalMoves = (length) * (length - 1) / 2 - 3;50 // FIXME: Should this be an exception or a warning for the logger?51 if (sampleSize >= totalMoves) throw new InvalidOperationException("StochasticTwoOptMoveGenerator: Sample size (" + sampleSize + ") is larger than the set of all possible moves (" + totalMoves + "), use the ExhaustiveTwoOptMoveGenerator instead.");52 49 TwoOptMove[] moves = new TwoOptMove[sampleSize]; 53 50 for (int i = 0; i < sampleSize; i++) {
Note: See TracChangeset
for help on using the changeset viewer.