Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/30/11 11:36:05 (13 years ago)
Author:
svonolfe
Message:

Added support for the multi depot CVRP with time windows (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MDCVRP/MDCVRPEvaluator.cs

    r6851 r6854  
    111111      double overloadPenalty = cvrp.OverloadPenalty.Value;
    112112
    113       costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution);
     113      double startDistance, endDistance;
     114      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
    114115
    115116      double demand = instance.GetDemand(customer);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPEvaluator.cs

    r6851 r6854  
    8181      double costs = 0;
    8282      feasible = true;
     83      double startDistance, endDistance;
    8384
    84       costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution);
     85      costs += instance.GetInsertionDistance(insertionInfo.Start, customer, insertionInfo.End, solution, out startDistance, out endDistance);
    8586
    8687      return costs;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs

    r6851 r6854  
    150150    }
    151151
    152     public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution) {
     152    public override double GetInsertionDistance(int start, int customer, int end, IVRPEncoding solution,
     153      out double startDistance, out double endDistance) {
    153154      if (start == 0) {
    154155        start = GetDepot(end, solution);
     
    164165     
    165166      double distance = base.GetDistance(start, end, solution);
    166       double newDistance =
    167         base.GetDistance(start, customer, solution) +
    168         base.GetDistance(customer, end, solution);
     167
     168      startDistance = base.GetDistance(start, customer, solution);
     169      endDistance = base.GetDistance(customer, end, solution);
     170
     171      double newDistance = startDistance + endDistance;
    169172
    170173      return newDistance - distance;
Note: See TracChangeset for help on using the changeset viewer.