Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/13/11 16:00:19 (13 years ago)
Author:
svonolfe
Message:

Added support for incremental evaluation to improve performance (#1177)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluation.cs

    r4454 r6752  
    2424using System.Linq;
    2525using System.Text;
     26using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Core;
     28using HeuristicLab.Common;
    2629
    2730namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     31  public class StopInsertionInfo {   
     32    private int start;
     33
     34    public int Start {
     35      get { return start; }
     36    }
     37
     38    private int end;
     39
     40    public int End {
     41      get { return end; }
     42    }
     43       
     44    public StopInsertionInfo(int start, int end)
     45      : base() {
     46        this.start = start;
     47        this.end = end;
     48    }
     49  }
     50
     51  public class TourInsertionInfo {
     52    public double Penalty { get; set; }
     53
     54    private List<StopInsertionInfo> stopInsertionInfos;
     55
     56    public TourInsertionInfo()
     57      : base() {
     58      stopInsertionInfos = new List<StopInsertionInfo>();
     59    }
     60
     61    public void AddStopInsertionInfo(StopInsertionInfo info) {
     62      stopInsertionInfos.Add(info);
     63    }
     64
     65   public StopInsertionInfo GetStopInsertionInfo(int stop) {
     66      return stopInsertionInfos[stop];
     67    }
     68
     69    public int GetStopCount() {
     70      return stopInsertionInfos.Count;
     71    }
     72  }
     73
     74  public class InsertionInfo {
     75    private List<TourInsertionInfo> tourInsertionInfos;
     76   
     77    public InsertionInfo()
     78      : base() {
     79        tourInsertionInfos = new List<TourInsertionInfo>();
     80    }
     81
     82    public void AddTourInsertionInfo(TourInsertionInfo info) {     
     83      tourInsertionInfos.Add(info);
     84    }
     85
     86    public TourInsertionInfo GetTourInsertionInfo(int tour) {
     87      return tourInsertionInfos[tour];
     88    }
     89  }
     90 
    2891  public class VRPEvaluation {
    2992    public double Quality { get; set; }
    3093    public double Distance { get; set; }
    3194    public int VehicleUtilization { get; set; }
     95    public InsertionInfo InsertionInfo { get; set; }
    3296
    3397    public double Penalty { get; set; }
     98
     99    public VRPEvaluation() {
     100      InsertionInfo = new InsertionInfo();
     101    }
    34102  }
    35103}
Note: See TracChangeset for help on using the changeset viewer.