# Changeset 17529

Ignore:
Timestamp:
05/08/20 11:21:57 (2 months ago)
Message:

#2521: some fixes and reusing handling of distance measure as defined in TSP

Location:
branches/2521_ProblemRefactoring
Files:
6 edited

Unmodified
Removed
• ## branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs

 r17226 /// Describes instances of the Vehicle Routing Problem (VRP). /// public class VRPData : IVRPData { /// /// The name of the instance /// public string Name { get; set; } /// /// Optional! The description of the instance /// public string Description { get; set; } /// /// The number of customers and the depot /// public int Dimension { get; set; } /// /// The distance measure that is used to calculate the distance between ///the coordinates if no is given. /// public DistanceMeasure DistanceMeasure { get; set; } public class VRPData : TSPData, IVRPData { /// /// Optional! The maximum number of vehicles that can be used. /// public double? MaximumVehicles { get; set; } /// /// Either Distances or the need to be specified along /// with a distance measure. /// public double[,] Distances { get; set; } /// /// Optional! A a matrix of dimension [N, 2] where each row is either the customer /// or the depot and the columns represent x and y coordinates respectively. /// /// /// Either or the Coordinates need to be specified along /// with a distance measure. /// public double[,] Coordinates { get; set; } /// /// The demand vector that specifies how many goods need to be delivered. /// Optional! The best-known solution as a list of tours in path-encoding. /// public int[][] BestKnownTour { get; set; } public new int[][] BestKnownTour { get; set; } /// /// Optional! Specifies the used vehicle for a given tour. /// public int[] BestKnownTourVehicleAssignment { get; set; } /// /// Optional! The quality of the best-known solution. /// public double? BestKnownQuality { get; set; } /// /// If only the coordinates are given, can calculate the distance matrix. /// /// A full distance matrix between all cities. public double[,] GetDistanceMatrix() { return DistanceHelper.GetDistanceMatrix(DistanceMeasure, Coordinates, Distances, Dimension); } } }