Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/19/10 16:51:30 (14 years ago)
Author:
svonolfe
Message:

Added prins encoding (#1039)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/Interfaces/IVRPMove.cs

    r4205 r4268  
    2727namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
    2828  public interface IVRPMove : IItem {
    29     TourEvaluation GetMoveQuality(IVRPEncoding individual,
     29    TourEvaluation GetMoveQuality(IVRPEncoding individual,  IntValue vehicles,
    3030        DoubleArray dueTimeArray, DoubleArray serviceTimeArray, DoubleArray readyTimeArray, DoubleArray demandArray,
    3131        DoubleValue capacity,DoubleMatrix coordinates,
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs

    r4205 r4268  
    4747      return move.GetMoveQuality(
    4848        VRPToursParameter.ActualValue,
     49        VehiclesParameter.ActualValue,
    4950        DueTimeParameter.ActualValue,
    5051        ServiceTimeParameter.ActualValue,
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/TourEncoding.cs

    r4230 r4268  
    3737   
    3838    #region IVRPEncoding Members
    39     public virtual List<Tour> GetTours() {
    40       return new List<Tour>(Tours);
     39    public virtual List<Tour> GetTours(ILookupParameter<DoubleMatrix> distanceMatrix = null, int maxVehicles = int.MaxValue) {
     40      List<Tour> result = new List<Tour>(Tours);
     41
     42      while (result.Count > maxVehicles) {
     43        Tour tour = result[result.Count - 1];
     44        result[result.Count - 2].Cities.AddRange(tour.Cities);
     45
     46        result.Remove(tour);
     47      }
     48
     49      return result;
    4150    }
    4251
     
    6675      : base() {
    6776    }
    68    
    69     public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution) {
    70       solution.Tours = new ItemList<Tour>(encoding.GetTours());
     77
     78    public static void ConvertFrom(IVRPEncoding encoding, TourEncoding solution, ILookupParameter<DoubleMatrix> distanceMatrix) {
     79      solution.Tours = new ItemList<Tour>(encoding.GetTours(distanceMatrix));
    7180    }
    7281
Note: See TracChangeset for help on using the changeset viewer.