Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/08/20 16:55:51 (5 years ago)
Author:
abeham
Message:

#2521: Unified architecture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Orienteering/3.3/Improvers/OrienteeringLocalImprovementOperator.cs

    r17525 r17533  
    126126
    127127        // Determine all points that have not yet been visited by this tour
    128         var visitablePoints = Enumerable.Range(0, data.RoutingData.Cities).Except(tour).ToList();
     128        var visitablePoints = Enumerable.Range(0, data.Cities).Except(tour).ToList();
    129129
    130130        // Determine if any of the visitable points can be included at any position within the tour
     
    168168            double newLength = tourLength;
    169169            // Recalculate length of whole swapped part, in case distances are not symmetric
    170             for (int index = position - 1; index < position + blockLength; index++) newLength -= data.RoutingData.GetDistance(tour[index], tour[index + 1]);
    171             for (int index = position + blockLength - 1; index > position; index--) newLength += data.RoutingData.GetDistance(tour[index], tour[index - 1]);
    172             newLength += data.RoutingData.GetDistance(tour[position - 1], tour[position + blockLength - 1]);
    173             newLength += data.RoutingData.GetDistance(tour[position], tour[position + blockLength]);
     170            for (int index = position - 1; index < position + blockLength; index++) newLength -= data.GetDistance(tour[index], tour[index + 1]);
     171            for (int index = position + blockLength - 1; index > position; index--) newLength += data.GetDistance(tour[index], tour[index - 1]);
     172            newLength += data.GetDistance(tour[position - 1], tour[position + blockLength - 1]);
     173            newLength += data.GetDistance(tour[position], tour[position + blockLength]);
    174174
    175175            if (newLength < tourLength - 0.00001) {
Note: See TracChangeset for help on using the changeset viewer.