Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6855 for branches/VRP


Ignore:
Timestamp:
09/30/11 12:55:55 (13 years ago)
Author:
svonolfe
Message:

Added possibility to add a ready time to depots (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances
Files:
5 edited

Legend:

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

    r6854 r6855  
    8686      double spareCapacity = capacity - delivered;
    8787
     88      double tourStartTime = vrptw.ReadyTime[depot];
     89      time = tourStartTime;
     90
    8891      //simulate a tour, start and end at depot
    8992      for (int i = 0; i <= tour.Stops.Count; i++) {
     
    131134        time += currentServiceTime;
    132135
    133         CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, arrivalTime, time, spareTime, waitTime);
     136        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
    134137        tourInfo.AddStopInsertionInfo(stopInfo);
    135138      }
     
    199202      if (index > 0)
    200203        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
     204      else
     205        time = insertionInfo.TourStartTime;
     206
    201207      time += startDistance;
    202208
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluation.cs

    r6752 r6855  
    4141    }
    4242
    43     public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity)
    44       : base(start, end, spareCapacity, arrivalTime, leaveTime, spareTime, waitingTime) {
     43    public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime,
     44      double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity)
     45      : base(start, end, spareCapacity, tourStartTime, arrivalTime, leaveTime, spareTime, waitingTime) {
    4546        this.visited = visited;
    4647        this.arrivalSpareCapacity = arrivalSpareCapacity;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs

    r6851 r6855  
    7575      int pickupViolations = 0;
    7676
     77      double tourStartTime = readyTime[0];
     78      time = tourStartTime;
     79
    7780      //simulate a tour, start and end at depot
    7881      for (int i = 0; i <= tour.Stops.Count; i++) {
     
    130133
    131134        double spareCapacity = capacity - currentLoad;
    132         CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
     135        CVRPPDTWInsertionInfo stopInfo = new CVRPPDTWInsertionInfo(start, end, spareCapacity, tourStartTime,
     136          arrivalTime, time, spareTime, waitTime, new List<int>(stops.Keys), arrivalSpareCapacity);
    133137        tourInfo.AddStopInsertionInfo(stopInfo);
    134138
     
    215219      if (index > 0)
    216220        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
     221      else
     222        time = insertionInfo.TourStartTime;
     223
    217224      time += instance.GetDistance(insertionInfo.Start, customer, solution);
    218225      if (time > dueTime[customer]) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluation.cs

    r6752 r6855  
    2929namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3030  public class CVRPTWInsertionInfo : CVRPInsertionInfo {
     31    private double tourStartTime;
     32
     33    public double TourStartTime {
     34      get { return tourStartTime; }
     35    }
     36   
    3137    private double arrivalTime;
    3238
     
    5359    }
    5460
    55     public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double arrivalTime, double leaveTime, double spareTime, double waitingTime)
     61    public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, double arrivalTime, double leaveTime, double spareTime, double waitingTime)
    5662      : base(start, end, spareCapacity) {
     63        this.tourStartTime = tourStartTime;
    5764        this.arrivalTime = arrivalTime;
    5865        this.leaveTime = leaveTime;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs

    r6851 r6855  
    8282      double spareCapacity = capacity - delivered;
    8383
     84      double tourStartTime = readyTime[0];
     85      time = tourStartTime;
     86
    8487      //simulate a tour, start and end at depot
    8588      for (int i = 0; i <= tour.Stops.Count; i++) {
     
    119122        time += currentServiceTime;
    120123
    121         CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, arrivalTime, time, spareTime, waitTime);
     124        CVRPTWInsertionInfo stopInfo = new CVRPTWInsertionInfo(start, end, spareCapacity, tourStartTime, arrivalTime, time, spareTime, waitTime);
    122125        tourInfo.AddStopInsertionInfo(stopInfo);
    123126      }
     
    186189      if (index > 0)
    187190        time = (tourInsertionInfo.GetStopInsertionInfo(index - 1) as CVRPTWInsertionInfo).LeaveTime;
     191      else
     192        time = insertionInfo.TourStartTime;
     193
    188194      time += instance.GetDistance(insertionInfo.Start, customer, solution);
    189195      if (time > dueTime[customer]) {
Note: See TracChangeset for help on using the changeset viewer.