Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/18/10 20:56:34 (14 years ago)
Author:
abeham
Message:

Updated simulated annealing:

  • Added inner loop to noticeably speed up algorithm
  • Removed exception in StochasticTwoOptMultiMoveGenerator when more moves would be generated than from the exhaustive move generator. The StochasticTwoOptMultiMoveGenerator simply draws from all moves with replacement.

#923

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Moves/TwoOpt/StochasticTwoOptMultiMoveGenerator.cs

    r3098 r3101  
    4747    public static TwoOptMove[] Apply(Permutation permutation, IRandom random, int sampleSize) {
    4848      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.");
    5249      TwoOptMove[] moves = new TwoOptMove[sampleSize];
    5350      for (int i = 0; i < sampleSize; i++) {
Note: See TracChangeset for help on using the changeset viewer.