Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/03/20 08:44:52 (4 years ago)
Author:
abeham
Message:

#2521: working on VRP

Location:
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluation.cs

    r17226 r17708  
    2121
    2222using System.Collections.Generic;
     23using System.Linq;
     24using HEAL.Attic;
     25using HeuristicLab.Common;
     26using HeuristicLab.Core;
    2327
    2428namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     29  [Item("CVRPPDTWInsertionInfo", "")]
     30  [StorableType("acb4ecf2-70a5-42ec-a2a5-68b11bd033e2")]
    2531  public class CVRPPDTWInsertionInfo : CVRPTWInsertionInfo {
    26     private List<int> visited;
     32    [Storable] public List<int> Visited { get; private set; }
     33    [Storable] public double ArrivalSpareCapacity { get; private set; }
    2734
    28     public List<int> Visited {
    29       get { return visited; }
     35    [StorableConstructor]
     36    protected CVRPPDTWInsertionInfo(StorableConstructorFlag _) : base(_) { }
     37    protected CVRPPDTWInsertionInfo(CVRPPDTWInsertionInfo original, Cloner cloner)
     38      : base(original, cloner) {
     39      Visited = original.Visited.ToList();
     40      ArrivalSpareCapacity = original.ArrivalSpareCapacity;
    3041    }
    31 
    32     private double arrivalSpareCapacity;
    33 
    34     public double ArrivalSpareCapacity {
    35       get { return arrivalSpareCapacity; }
    36     }
    37 
    3842    public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime,
    3943      double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity)
    4044      : base(start, end, spareCapacity, tourStartTime, arrivalTime, leaveTime, spareTime, waitingTime) {
    41       this.visited = visited;
    42       this.arrivalSpareCapacity = arrivalSpareCapacity;
     45      Visited = visited;
     46      ArrivalSpareCapacity = arrivalSpareCapacity;
     47    }
     48
     49    public override IDeepCloneable Clone(Cloner cloner) {
     50      return new CVRPPDTWInsertionInfo(this, cloner);
    4351    }
    4452  }
    4553
     54  [Item("CVRPPDTWEvaluation", "")]
     55  [StorableType("877ae91a-708f-4b32-95f3-d790e0efc018")]
    4656  public class CVRPPDTWEvaluation : CVRPTWEvaluation {
    47     public int PickupViolations { get; set; }
     57    [Storable] public int PickupViolations { get; set; }
     58
     59    [StorableConstructor]
     60    protected CVRPPDTWEvaluation(StorableConstructorFlag _) : base(_) { }
     61    protected CVRPPDTWEvaluation(CVRPPDTWEvaluation original, Cloner cloner)
     62      : base(original, cloner) {
     63      PickupViolations = original.PickupViolations;
     64    }
     65    public CVRPPDTWEvaluation() { }
     66
     67    public override IDeepCloneable Clone(Cloner cloner) {
     68      return new CVRPPDTWEvaluation(this, cloner);
     69    }
    4870  }
    4971}
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluation.cs

    r17226 r17708  
    2121
    2222
     23using HEAL.Attic;
     24using HeuristicLab.Common;
     25using HeuristicLab.Core;
     26
    2327namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     28  [Item("CVRPTWInsertionInfo", "")]
     29  [StorableType("487635b5-2682-42a2-9ec2-1a210e6ce88c")]
    2430  public class CVRPTWInsertionInfo : CVRPInsertionInfo {
    25     private double tourStartTime;
    2631
    27     public double TourStartTime {
    28       get { return tourStartTime; }
     32    [Storable] public double TourStartTime { get; private set; }
     33    [Storable] public double ArrivalTime { get; private set; }
     34    [Storable] public double LeaveTime { get; private set; }
     35    [Storable] public double SpareTime { get; private set; }
     36    [Storable] public double WaitingTime { get; private set; }
     37
     38
     39    [StorableConstructor]
     40    protected CVRPTWInsertionInfo(StorableConstructorFlag _) : base(_) { }
     41    protected CVRPTWInsertionInfo(CVRPTWInsertionInfo original, Cloner cloner)
     42      : base(original, cloner) {
     43      TourStartTime = original.TourStartTime;
     44      ArrivalTime = original.ArrivalTime;
     45      LeaveTime = original.LeaveTime;
     46      SpareTime = original.SpareTime;
     47      WaitingTime = original.WaitingTime;
    2948    }
    30 
    31     private double arrivalTime;
    32 
    33     public double ArrivalTime {
    34       get { return arrivalTime; }
    35     }
    36 
    37     private double leaveTime;
    38 
    39     public double LeaveTime {
    40       get { return leaveTime; }
    41     }
    42 
    43     private double spareTime;
    44 
    45     public double SpareTime {
    46       get { return spareTime; }
    47     }
    48 
    49     private double waitingTime;
    50 
    51     public double WaitingTime {
    52       get { return waitingTime; }
    53     }
    54 
    5549    public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, double arrivalTime, double leaveTime, double spareTime, double waitingTime)
    5650      : base(start, end, spareCapacity) {
    57       this.tourStartTime = tourStartTime;
    58       this.arrivalTime = arrivalTime;
    59       this.leaveTime = leaveTime;
    60       this.spareTime = spareTime;
    61       this.waitingTime = waitingTime;
     51      TourStartTime = tourStartTime;
     52      ArrivalTime = arrivalTime;
     53      LeaveTime = leaveTime;
     54      SpareTime = spareTime;
     55      WaitingTime = waitingTime;
    6256    }
    6357  }
    6458
     59  [Item("CVRPTWEvaluation", "")]
     60  [StorableType("b3b31244-5ac8-4007-9ae6-249e2a7d5321")]
    6561  public class CVRPTWEvaluation : CVRPEvaluation {
    66     public double Tardiness { get; set; }
    67     public double TravelTime { get; set; }
     62    [Storable] public double Tardiness { get; set; }
     63    [Storable] public double TravelTime { get; set; }
     64
     65    [StorableConstructor]
     66    protected CVRPTWEvaluation(StorableConstructorFlag _) : base(_) { }
     67    protected CVRPTWEvaluation(CVRPTWEvaluation original, Cloner cloner)
     68      : base(original, cloner) {
     69      Tardiness = original.Tardiness;
     70      TravelTime = original.TravelTime;
     71    }
     72    public CVRPTWEvaluation() { }
     73
     74    public override IDeepCloneable Clone(Cloner cloner) {
     75      return new CVRPTWEvaluation(this, cloner);
     76    }
    6877  }
    6978}
Note: See TracChangeset for help on using the changeset viewer.