Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7880 for trunk


Ignore:
Timestamp:
05/23/12 17:28:09 (12 years ago)
Author:
svonolfe
Message:

Added VRP data types (#1782)

Location:
trunk/sources/HeuristicLab.Problems.Instances/3.3
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj

    r7872 r7880  
    118118    <Compile Include="IDataDescriptor.cs" />
    119119    <Compile Include="Types\DistanceHelper.cs" />
     120    <Compile Include="Types\VRP\MDCVRPTWData.cs" />
     121    <Compile Include="Types\VRP\MDCVRPData.cs" />
     122    <Compile Include="Types\VRP\PDPTWData.cs" />
     123    <Compile Include="Types\VRP\CVRPTWData.cs" />
     124    <Compile Include="Types\VRP\VRPData.cs" />
    120125    <Compile Include="Types\VRP\CVRPData.cs" />
    121126    <Compile Include="Types\GQAPData.cs" />
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs

    r7872 r7880  
    2525  /// Describes instances of the Capacitated Vehicle Routing Problem (CVRP).
    2626  /// </summary>
    27   public class CVRPData: IVRPData {
    28     /// <summary>
    29     /// The name of the instance
    30     /// </summary>
    31     public string Name { get; set; }
    32     /// <summary>
    33     /// Optional! The description of the instance
    34     /// </summary>
    35     public string Description { get; set; }
    36 
    37     /// <summary>
    38     /// The number of customers and the depot
    39     /// </summary>
    40     public int Dimension { get; set; }
    41     /// <summary>
    42     /// The distance measure that is used to calculate the distance between
    43     ///the coordinates if no <see cref="Distances"/> is given.
    44     /// </summary>
    45     public DistanceMeasure DistanceMeasure { get; set; }
    46     /// <summary>
    47     /// Optional! The maximum number of vehicles that can be used.
    48     /// </summary>
    49     /// <remarks>
    50     /// If no number is given, but a maximum is required, it can be assumed that
    51     /// the maximum number of vehicles is equal to the number of customers as
    52     /// there cannot be more than one vehicle per customer.
    53     /// </remarks>
    54     public double? MaximumVehicles { get; set; }
     27  public class CVRPData: VRPData {
    5528    /// <summary>
    5629    /// The capacity of the vehicles, which is the same for all (homogeneous fleet).
    5730    /// </summary>
    5831    public double Capacity { get; set; }
    59     /// <summary>
    60     /// Optional! The distances are given in form of a distance matrix.
    61     /// </summary>
    62     /// <remarks>
    63     /// Either Distances or the <see cref="Coordinates"/> need to be specified along
    64     /// with a distance measure.
    65     /// </remarks>
    66     public double[,] Distances { get; set; }
    67     /// <summary>
    68     /// Optional! A a matrix of dimension [N, 2] where each row is either the customer
    69     /// or the depot and the columns represent x and y coordinates respectively.
    70     /// </summary>
    71     /// <remarks>
    72     /// Either <see cref="Distances"/> or the Coordinates need to be specified along
    73     /// with a distance measure.
    74     /// </remarks>
    75     public double[,] Coordinates { get; set; }
    76     /// <summary>
    77     /// The demand vector that specifies how many goods need to be delivered.
    78     /// The vector has to include the depot, but with a demand of 0.
    79     /// </summary>
    80     public double[] Demands { get; set; }
    81 
    82     /// <summary>
    83     /// Optional! The best-known solution as a list of tours in path-encoding.
    84     /// </summary>
    85     public int[][] BestKnownTour { get; set; }
    86     /// <summary>
    87     /// Optional! The quality of the best-known solution.
    88     /// </summary>
    89     public double? BestKnownQuality { get; set; }
    90 
    91     /// <summary>
    92     /// If only the coordinates are given, can calculate the distance matrix.
    93     /// </summary>
    94     /// <returns>A full distance matrix between all cities.</returns>
    95     public double[,] GetDistanceMatrix() {
    96       return DistanceHelper.GetDistanceMatrix(DistanceMeasure, Coordinates, Distances, Dimension);
    97     }
    9832  }
    9933}
  • trunk/sources/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs

    r7872 r7880  
    2727namespace HeuristicLab.Problems.Instances {
    2828  /// <summary>
    29   /// Marker interface for VRP data
     29  /// Interface for VRP data
    3030  /// </summary>
    3131  public interface IVRPData {
     32    string Name { get; set; }
     33    string Description { get; set; }
     34    int Dimension { get; set; }
     35    double? BestKnownQuality { get; set; }
     36    int[][] BestKnownTour { get; set; }
    3237  }
    3338}
Note: See TracChangeset for help on using the changeset viewer.