Changeset 14677 for branches/OptimizationNetworks/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluation.cs
- Timestamp:
- 02/16/17 15:16:55 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluation.cs
r14185 r14677 20 20 #endregion 21 21 22 using System.Globalization; 23 using System.Linq; 24 using System.Text; 22 25 23 26 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances { 24 public class CVRP InsertionInfo : StopInsertionInfo {27 public class CVRPStopInsertionInfo : StopInsertionInfo { 25 28 private double spareCapacity; 26 29 … … 29 32 } 30 33 31 public CVRP InsertionInfo(int start, int end, double spareCapacity)32 : base(start, end ) {34 public CVRPStopInsertionInfo(int start, int end, double distance, double spareCapacity) 35 : base(start, end, distance) { 33 36 this.spareCapacity = spareCapacity; 37 } 38 39 protected override void GetStopInsertionReport(StringBuilder builder) { 40 base.GetStopInsertionReport(builder); 41 builder.Append("Capacity left:\t"); 42 builder.AppendLine(SpareCapacity.ToString(CultureInfo.CurrentCulture)); 43 } 44 } 45 46 public class CVRPTourInsertionInfo : TourInsertionInfo { 47 private double capacity; 48 49 public virtual double SpareCapacity { 50 get { return stopInsertionInfos.Count == 0 ? capacity : ((CVRPStopInsertionInfo)stopInsertionInfos.Last()).SpareCapacity; } 51 } 52 53 public CVRPTourInsertionInfo(int vehicle, double capacity) 54 : base(vehicle) { 55 this.capacity = capacity; 56 } 57 58 protected override void GetTourInsertionReport(StringBuilder builder) { 59 base.GetTourInsertionReport(builder); 60 builder.Append("Capacity left:\t"); 61 builder.AppendLine(SpareCapacity.ToString(CultureInfo.CurrentCulture)); 34 62 } 35 63 } … … 37 65 public class CVRPEvaluation : VRPEvaluation { 38 66 public double Overload { get; set; } 67 68 protected override void GetEvaluationReport(StringBuilder builder) { 69 base.GetEvaluationReport(builder); 70 builder.Append("Overload:\t"); 71 builder.AppendLine(Overload.ToString(CultureInfo.CurrentCulture)); 72 } 39 73 } 40 74 }
Note: See TracChangeset
for help on using the changeset viewer.