Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/10/10 13:00:54 (14 years ago)
Author:
svonolfe
Message:

Improved performance of PotvinEncoding(#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs

    r4376 r4378  
    9999      for (int tour = 0; tour < Tours.Count; tour++) {
    100100        if (tour != routeToAvoid) {
     101          double length = GetTourLength(Tours[tour]);
     102
    101103          for (int i = 0; i <= Tours[tour].Stops.Count; i++) {
    102             double length = GetTourLength(Tours[tour]);
    103 
    104104            Tours[tour].Stops.Insert(i, city);
    105105
    106             if (ProblemInstance.Feasible(Tours[tour])) {
    107               double newLength = GetTourLength(Tours[tour]);
     106            VRPEvaluation eval = ProblemInstance.EvaluatorParameter.Value.Evaluate(
     107              ProblemInstance, Tours[tour]);
     108            if (ProblemInstance.EvaluatorParameter.Value.Feasible(eval)) {
     109              double newLength = eval.Distance;
    108110
    109111              double detour = newLength - length;
Note: See TracChangeset for help on using the changeset viewer.