Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 13:36:49 (14 years ago)
Author:
svonolfe
Message:

Improved performance of many VRP operators by optimizing the parameter lookup (#1561)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Evaluators/VRPEvaluator.cs

    r5445 r6449  
    116116      DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray, DoubleValue capacity,
    117117      DoubleValue fleetUsageFactor, DoubleValue timeFactor, DoubleValue distanceFactor, DoubleValue overloadPenalty, DoubleValue tardinessPenalty,
    118       DoubleMatrix coordinates, IParameter distanceMatrix, BoolValue useDistanceMatrix) {
     118      DistanceMatrix distMatrix) {
    119119      TourEvaluation eval = new TourEvaluation();
    120120
     
    140140
    141141        //drive there
    142         double currentDistace = VRPUtilities.GetDistance(start, end, coordinates, distanceMatrix, useDistanceMatrix);
     142        double currentDistace = VRPUtilities.GetDistance(start, end, distMatrix);
    143143        distance += currentDistace;
    144144        time += currentDistace;
     
    199199      sumEval.Tardiness = 0;
    200200
     201      DistanceMatrix distMatrix = VRPUtilities.GetDistanceMatrix(coordinates, distanceMatrix, useDistanceMatrix);
     202
    201203      foreach (Tour tour in solution.GetTours(distanceMatrix as ILookupParameter<DoubleMatrix>)) {
    202204        TourEvaluation eval = EvaluateTour(tour, dueTimeArray, serviceTimeArray, readyTimeArray, demandArray, capacity,
    203205          fleetUsageFactor, timeFactor, distanceFactor, overloadPenalty, tardinessPenalty,
    204           coordinates, distanceMatrix, useDistanceMatrix);
     206          distMatrix);
    205207        sumEval.Quality += eval.Quality;
    206208        sumEval.Distance += eval.Distance;
Note: See TracChangeset for help on using the changeset viewer.