Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/16/17 15:16:55 (7 years ago)
Author:
abeham
Message:

#2205: added results tab to solution view to analyze vrp solution in more detail

  • reorganized insertion infos and adapted some evaluators and instances
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OptimizationNetworks/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluation.cs

    r14185 r14677  
    2020#endregion
    2121
     22using System.Globalization;
     23using System.Linq;
     24using System.Text;
    2225
    2326namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    24   public class CVRPInsertionInfo : StopInsertionInfo {
     27  public class CVRPStopInsertionInfo : StopInsertionInfo {
    2528    private double spareCapacity;
    2629
     
    2932    }
    3033
    31     public CVRPInsertionInfo(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) {
    3336      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));
    3462    }
    3563  }
     
    3765  public class CVRPEvaluation : VRPEvaluation {
    3866    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    }
    3973  }
    4074}
Note: See TracChangeset for help on using the changeset viewer.