Changeset 17708
- Timestamp:
- 08/03/20 08:44:52 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj
r17698 r17708 135 135 <Compile Include="Analyzer\ConstraintRelaxation\TimeWindowed\TimeWindowRelaxationVRPAnalyzer.cs" /> 136 136 <Compile Include="Analyzer\VRPSolution.cs" /> 137 <Compile Include="Encodings\MultiVRPEncoding.cs" /> 137 138 <Compile Include="Encodings\Alba\AlbaEncoding.cs" /> 139 <Compile Include="Encodings\GVR\GVREncoding.cs" /> 140 <Compile Include="Encodings\Potvin\PotvinEncoding.cs" /> 138 141 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\IPotvinTwoOptStarMoveOperator.cs" /> 139 142 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarExhaustiveMoveGenerator.cs" /> … … 147 150 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarMultiMoveGenerator.cs" /> 148 151 <Compile Include="Encodings\Potvin\Moves\TwoOptStar\PotvinTwoOptStarSingleMoveGenerator.cs" /> 152 <Compile Include="Encodings\Prins\PrinsEncoding.cs" /> 153 <Compile Include="Encodings\Zhu\ZhuEncoding.cs" /> 149 154 <Compile Include="Improver\VRPImprovementOperator.cs" /> 150 155 <Compile Include="Improver\VRPIntraRouteImprovementOperator.cs" /> -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluation.cs
r17226 r17708 21 21 22 22 23 using HEAL.Attic; 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 26 23 27 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 28 [Item("CVRPInsertionInfo", "")] 29 [StorableType("f951554e-dbe1-4dfb-a6b2-b477b9f79fcd")] 24 30 public class CVRPInsertionInfo : StopInsertionInfo { 25 private double spareCapacity;31 [Storable] public double SpareCapacity { get; private set; } 26 32 27 public double SpareCapacity { 28 get { return spareCapacity; } 33 [StorableConstructor] 34 protected CVRPInsertionInfo(StorableConstructorFlag _) : base(_) { } 35 protected CVRPInsertionInfo(CVRPInsertionInfo original, Cloner cloner) 36 : base(original, cloner) { 37 SpareCapacity = original.SpareCapacity; 38 } 39 public CVRPInsertionInfo(int start, int end, double spareCapacity) 40 : base(start, end) { 41 SpareCapacity = spareCapacity; 29 42 } 30 43 31 public CVRPInsertionInfo(int start, int end, double spareCapacity) 32 : base(start, end) { 33 this.spareCapacity = spareCapacity; 44 public override IDeepCloneable Clone(Cloner cloner) { 45 return new CVRPInsertionInfo(this, cloner); 34 46 } 35 47 } 36 48 49 [Item("CVRPEvaluation", "")] 50 [StorableType("e3d4c547-3028-4c95-8ea8-1fe234d54ed3")] 37 51 public class CVRPEvaluation : VRPEvaluation { 38 public double Overload { get; set; } 52 [Storable] public double Overload { get; set; } 53 54 [StorableConstructor] 55 protected CVRPEvaluation(StorableConstructorFlag _) : base(_) { } 56 protected CVRPEvaluation(CVRPEvaluation original, Cloner cloner) 57 : base(original, cloner) { 58 Overload = original.Overload; 59 } 60 public CVRPEvaluation() { } 61 62 63 public override IDeepCloneable Clone(Cloner cloner) { 64 return new CVRPEvaluation(this, cloner); 65 } 39 66 } 40 67 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluation.cs
r17226 r17708 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 24 using HEAL.Attic; 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 23 27 24 28 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 29 [Item("CVRPPDTWInsertionInfo", "")] 30 [StorableType("acb4ecf2-70a5-42ec-a2a5-68b11bd033e2")] 25 31 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; } 27 34 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; 30 41 } 31 32 private double arrivalSpareCapacity;33 34 public double ArrivalSpareCapacity {35 get { return arrivalSpareCapacity; }36 }37 38 42 public CVRPPDTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, 39 43 double arrivalTime, double leaveTime, double spareTime, double waitingTime, List<int> visited, double arrivalSpareCapacity) 40 44 : 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); 43 51 } 44 52 } 45 53 54 [Item("CVRPPDTWEvaluation", "")] 55 [StorableType("877ae91a-708f-4b32-95f3-d790e0efc018")] 46 56 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 } 48 70 } 49 71 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluation.cs
r17226 r17708 21 21 22 22 23 using HEAL.Attic; 24 using HeuristicLab.Common; 25 using HeuristicLab.Core; 26 23 27 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 28 [Item("CVRPTWInsertionInfo", "")] 29 [StorableType("487635b5-2682-42a2-9ec2-1a210e6ce88c")] 24 30 public class CVRPTWInsertionInfo : CVRPInsertionInfo { 25 private double tourStartTime;26 31 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; 29 48 } 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 55 49 public CVRPTWInsertionInfo(int start, int end, double spareCapacity, double tourStartTime, double arrivalTime, double leaveTime, double spareTime, double waitingTime) 56 50 : 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; 62 56 } 63 57 } 64 58 59 [Item("CVRPTWEvaluation", "")] 60 [StorableType("b3b31244-5ac8-4007-9ae6-249e2a7d5321")] 65 61 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 } 68 77 } 69 78 } -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs
r17226 r17708 21 21 22 22 using System.Collections.Generic; 23 using System.Linq; 24 using HEAL.Attic; 25 using HeuristicLab.Common; 26 using HeuristicLab.Core; 27 using HeuristicLab.Optimization; 23 28 24 29 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 25 public class StopInsertionInfo { 26 private int start; 30 [Item("StopInsertionInfo", "")] 31 [StorableType("e4e2657a-0af9-4f1c-b396-887ad5b6f459")] 32 public class StopInsertionInfo : Item { 33 [Storable] public int Start { get; private set; } 34 [Storable] public int End { get; private set; } 27 35 28 public int Start { 29 get { return start; } 36 37 [StorableConstructor] 38 protected StopInsertionInfo(StorableConstructorFlag _) : base(_) { } 39 protected StopInsertionInfo(StopInsertionInfo original, Cloner cloner) 40 : base(original, cloner) { 41 Start = original.Start; 42 End = original.End; 43 } 44 public StopInsertionInfo(int start, int end) 45 : base() { 46 Start = start; 47 End = end; 30 48 } 31 49 32 private int end; 33 34 public int End { 35 get { return end; } 36 } 37 38 public StopInsertionInfo(int start, int end) 39 : base() { 40 this.start = start; 41 this.end = end; 50 public override IDeepCloneable Clone(Cloner cloner) { 51 return new StopInsertionInfo(this, cloner); 42 52 } 43 53 } 44 54 45 public class TourInsertionInfo { 46 public double Penalty { get; set; } 47 public double Quality { get; set; } 55 [Item("TourInsertionInfo", "")] 56 [StorableType("25a61cca-120b-43e2-845a-d290352ca1e9")] 57 public class TourInsertionInfo : Item { 58 [Storable] public double Penalty { get; set; } 59 [Storable] public double Quality { get; set; } 60 [Storable] public int Vehicle { get; set; } 61 [Storable] private List<StopInsertionInfo> stopInsertionInfos; 48 62 49 public int Vehicle { get; set; } 50 51 private List<StopInsertionInfo> stopInsertionInfos; 52 63 [StorableConstructor] 64 protected TourInsertionInfo(StorableConstructorFlag _) : base(_) { } 65 protected TourInsertionInfo(TourInsertionInfo original, Cloner cloner) 66 : base(original, cloner) { 67 Penalty = original.Penalty; 68 Quality = original.Quality; 69 Vehicle = original.Vehicle; 70 stopInsertionInfos = original.stopInsertionInfos.Select(cloner.Clone).ToList(); 71 } 53 72 public TourInsertionInfo(int vehicle) 54 73 : base() { 55 74 stopInsertionInfos = new List<StopInsertionInfo>(); 56 75 Vehicle = vehicle; 76 } 77 78 public override IDeepCloneable Clone(Cloner cloner) { 79 return new TourInsertionInfo(this, cloner); 57 80 } 58 81 … … 70 93 } 71 94 72 public class InsertionInfo { 73 private List<TourInsertionInfo> tourInsertionInfos; 95 [Item("InsertionInfo", "")] 96 [StorableType("ba569eb3-df25-4f73-bfa0-246b38c1d520")] 97 public class InsertionInfo : Item { 98 [Storable] private List<TourInsertionInfo> tourInsertionInfos; 74 99 100 [StorableConstructor] 101 protected InsertionInfo(StorableConstructorFlag _) : base(_) { } 102 protected InsertionInfo(InsertionInfo original, Cloner cloner) 103 : base(original, cloner) { 104 tourInsertionInfos = original.tourInsertionInfos.Select(cloner.Clone).ToList(); 105 } 75 106 public InsertionInfo() 76 107 : base() { 77 108 tourInsertionInfos = new List<TourInsertionInfo>(); 109 } 110 111 public override IDeepCloneable Clone(Cloner cloner) { 112 return new InsertionInfo(this, cloner); 78 113 } 79 114 … … 87 122 } 88 123 89 public class VRPEvaluation { 90 public double Quality { get; set; } 91 public double Distance { get; set; } 92 public int VehicleUtilization { get; set; } 93 public InsertionInfo InsertionInfo { get; set; } 124 [Item("VRPEvaluation", "")] 125 [StorableType("0c4dfa78-8e41-4558-b2dd-4a22954c35ba")] 126 public class VRPEvaluation : EvaluationResult { 127 [Storable] public double Quality { get; set; } 128 [Storable] public double Distance { get; set; } 129 [Storable] public int VehicleUtilization { get; set; } 130 [Storable] public InsertionInfo InsertionInfo { get; set; } 131 [Storable] public double Penalty { get; set; } 94 132 95 public double Penalty { get; set; }96 133 97 public VRPEvaluation() { 134 [StorableConstructor] 135 protected VRPEvaluation(StorableConstructorFlag _) : base(_) { } 136 protected VRPEvaluation(VRPEvaluation original, Cloner cloner) 137 : base(original, cloner) { 138 Quality = original.Quality; 139 Distance = original.Distance; 140 VehicleUtilization = original.VehicleUtilization; 141 InsertionInfo = cloner.Clone(original.InsertionInfo); 142 Penalty = original.Penalty; 143 } 144 public VRPEvaluation() : base() { 98 145 InsertionInfo = new InsertionInfo(); 146 } 147 148 public override IDeepCloneable Clone(Cloner cloner) { 149 return new VRPEvaluation(this, cloner); 99 150 } 100 151 }
Note: See TracChangeset
for help on using the changeset viewer.