Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/14 16:21:42 (9 years ago)
Author:
pfleck
Message:

#2229

  • The IVRPData now specifies an optional BestKnownTourVehicleAssignment property. This can be used for solutions where a specific assignment for tours to vehicles is necessary.
  • The VRPInterpreter interpret the new BestKnownTourVehicleAssignment directly as VehicleAssignment in the created PotvinEncoding.
  • Minor refactoring in (I)VRPInstanceProvider.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Interpreters/VRPInterpreter.cs

    r11171 r11428  
    2020#endregion
    2121
     22using System.IO;
    2223using HeuristicLab.Data;
    2324using HeuristicLab.Problems.Instances;
     
    4445        }
    4546
     47        if (data.BestKnownTourVehicleAssignment != null) {
     48          if (data.BestKnownTourVehicleAssignment.Length != solution.VehicleAssignment.Length)
     49            throw new InvalidDataException("Number of vehicles of the best known tour does not match the number vehicles of the instance.");
     50          for (int i = 0; i < data.BestKnownTourVehicleAssignment.Length; i++)
     51            solution.VehicleAssignment[i] = data.BestKnownTourVehicleAssignment[i];
     52        }
     53
    4654        return solution;
    4755      } else {
     
    5159
    5260    protected abstract IVRPProblemInstance CreateProblemInstance();
    53    
     61
    5462    public VRPInstanceDescription Interpret(IVRPData data) {
    5563      VRPInstanceDescription result = new VRPInstanceDescription();
Note: See TracChangeset for help on using the changeset viewer.