Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/20/11 13:36:49 (13 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/VRPOperator.cs

    r5445 r6449  
    123123      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
    124124    }
    125 
    126     protected bool Feasible(Tour tour) {
    127       return tour.Feasible(
    128                   DueTimeParameter.ActualValue,
    129                   ServiceTimeParameter.ActualValue,
    130                   ReadyTimeParameter.ActualValue,
    131                   DemandParameter.ActualValue,
    132                   CapacityParameter.ActualValue,
    133                   CoordinatesParameter.ActualValue,
    134                   DistanceMatrixParameter,
    135                   UseDistanceMatrixParameter.ActualValue);
    136     }
    137 
    138     protected bool Feasible(IVRPEncoding solution) {
    139       bool feasible = true;
    140 
    141       foreach (Tour tour in solution.GetTours(DistanceMatrixParameter)) {
    142         if (!Feasible(tour)) {
    143           feasible = false;
    144           break;
    145         }
    146       }
    147 
    148       return feasible;
    149     }
    150 
    151     protected double GetLength(Tour tour) {
    152       return tour.GetLength(
    153                 CoordinatesParameter.ActualValue,
    154                 DistanceMatrixParameter,
    155                 UseDistanceMatrixParameter.ActualValue);
    156     }
    157125  }
    158126}
Note: See TracChangeset for help on using the changeset viewer.