#region License Information /* HeuristicLab * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion namespace HeuristicLab.Problems.Instances { /// /// 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; } /// /// Optional! The maximum number of vehicles that can be used. /// /// /// If no number is given, but a maximum is required, it can be assumed that /// the maximum number of vehicles is equal to the number of customers as /// there cannot be more than one vehicle per customer. /// 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. /// The vector has to include the depot, but with a demand of 0. /// public double[] Demands { get; set; } /// /// Optional! The best-known solution as a list of tours in path-encoding. /// public 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); } } }