Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/11/17 23:06:32 (6 years ago)
Author:
abeham
Message:

#1614: Improved performance by switching from Dictionary to Array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment/3.3/Moves/NMoveTabuChecker.cs

    r15504 r15511  
    111111          isTabu = true;
    112112          foreach (var kvp in attribute.OldAssignments) {
    113             if (move.NewAssignments.ContainsKey(kvp.Key)) {
    114               if (move.NewAssignments[kvp.Key] != kvp.Value) {
    115                 isTabu = false;
    116                 break;
    117               }
     113            var assignedLoc = move.Reassignments[kvp.Item1] - 1; // location is given 1-based
     114            if (assignedLoc >= 0 && assignedLoc != kvp.Item2) {
     115              isTabu = false;
     116              break;
    118117            }
    119118          }
Note: See TracChangeset for help on using the changeset viewer.