Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj (revision 16827)
@@ -0,0 +1,189 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {3540E29E-4793-49E7-8EE2-FEA7F61C3994}
+ Library
+ Properties
+ HeuristicLab.Problems.Instances
+ HeuristicLab.Problems.Instances-3.3
+ v4.6.1
+ 512
+
+
+
+ true
+ full
+ false
+ ..\..\bin\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ pdbonly
+ true
+ ..\..\bin\
+ TRACE
+ prompt
+ 4
+ false
+
+
+ true
+
+
+ HeuristicLab.snk
+
+
+ true
+ ..\..\bin\
+ DEBUG;TRACE
+ full
+ x64
+ ..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ true
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ true
+ false
+ false
+
+
+ ..\..\bin\
+ TRACE
+ true
+ pdbonly
+ x64
+ ..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+ false
+
+
+ true
+ ..\..\bin\
+ DEBUG;TRACE
+ full
+ x86
+ ..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ true
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ true
+ false
+ false
+
+
+ ..\..\bin\
+ TRACE
+ true
+ pdbonly
+ x86
+ ..\..\bin\HeuristicLab.Problems.Instances-3.3.dll.CodeAnalysisLog.xml
+ true
+ GlobalSuppressions.cs
+ prompt
+ MinimumRecommendedRules.ruleset
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
+ false
+ ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
+ false
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}
+ HeuristicLab.Common-3.3
+ False
+
+
+ {94186A6A-5176-4402-AE83-886557B53CCA}
+ HeuristicLab.PluginInfrastructure-3.3
+ False
+
+
+
+
+ set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+
+export ProjectDir=$(ProjectDir)
+export SolutionDir=$(SolutionDir)
+
+$SolutionDir/PreBuildEvent.sh
+
+
+
+
+
+
+
+
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IDataDescriptor.cs (revision 16827)
@@ -0,0 +1,27 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 {
+ public interface IDataDescriptor {
+ string Name { get; }
+ string Description { get; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs (revision 16827)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.Instances {
+ public interface IProblemInstanceConsumer : IContent { }
+
+ public interface IProblemInstanceConsumer : IProblemInstanceConsumer {
+ ///
+ /// Loads the given instance data.
+ ///
+ /// Thrown when the instance cannot be loaded.
+ /// The data of the instance.
+ void Load(TData data);
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceExporter.cs (revision 16827)
@@ -0,0 +1,28 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 {
+ public interface IProblemInstanceExporter { }
+
+ public interface IProblemInstanceExporter : IProblemInstanceExporter {
+ TData Export();
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/IProblemInstanceProvider.cs (revision 16827)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+
+namespace HeuristicLab.Problems.Instances {
+ public interface IProblemInstanceProvider : IContent {
+ string Name { get; }
+ string Description { get; }
+ Uri WebLink { get; }
+ string ReferencePublication { get; }
+ }
+
+ public interface IProblemInstanceProvider : IProblemInstanceProvider {
+ IEnumerable GetDataDescriptors();
+ TData LoadData(IDataDescriptor descriptor);
+
+ bool CanImportData { get; }
+ TData ImportData(string path);
+
+ bool CanExportData { get; }
+ void ExportData(TData instance, string path);
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Plugin.cs.frame (revision 16827)
@@ -0,0 +1,30 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Instances {
+ [Plugin("HeuristicLab.Problems.Instances", "3.3.15.$WCREV$")]
+ [PluginFile("HeuristicLab.Problems.Instances-3.3.dll", PluginFileType.Assembly)]
+ [PluginDependency("HeuristicLab.Common", "3.3")]
+ public class HeuristicLabProblemsInstancesPlugin : PluginBase {
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceManager.cs (revision 16827)
@@ -0,0 +1,62 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.Problems.Instances {
+ public class ProblemInstanceManager {
+ public static IEnumerable GetProviders(object item) {
+ var consumerTypes = item.GetType().GetInterfaces()
+ .Where(x => x.IsGenericType
+ && x.GetGenericTypeDefinition() == typeof(IProblemInstanceConsumer<>));
+
+ if (consumerTypes.Any()) {
+ var instanceTypes = consumerTypes
+ .Select(x => x.GetGenericArguments().First())
+ .Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x));
+
+ var interfaceTypes = instanceTypes.Where(x => x.GetGenericArguments().First().IsInterface);
+ if (interfaceTypes.Any()) {
+ var concreteTypes = interfaceTypes.SelectMany(x => ApplicationManager.Manager.GetTypes(x.GetGenericArguments().First()));
+
+ if (concreteTypes.Any())
+ instanceTypes = instanceTypes.Union(concreteTypes.Select(x => typeof(IProblemInstanceProvider<>).MakeGenericType(x))).Distinct();
+ }
+
+ foreach (var type in instanceTypes) {
+ foreach (var provider in ApplicationManager.Manager.GetInstances(type))
+ yield return (IProblemInstanceProvider)provider;
+ }
+ }
+ }
+
+ public static IEnumerable GetDataDescriptors(IProblemInstanceProvider provider) {
+ IEnumerable descriptors = ((dynamic)provider).GetDataDescriptors();
+ return descriptors;
+ }
+
+ public static void LoadData(IProblemInstanceProvider provider, IDataDescriptor descriptor, IProblemInstanceConsumer consumer) {
+ ((dynamic)consumer).Load(((dynamic)provider).LoadData(descriptor));
+ }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/ProblemInstanceProvider.cs (revision 16827)
@@ -0,0 +1,50 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.Instances {
+ public abstract class ProblemInstanceProvider : IProblemInstanceProvider {
+ public abstract string Name { get; }
+ public abstract string Description { get; }
+ public abstract Uri WebLink { get; }
+ public abstract string ReferencePublication { get; }
+
+ public abstract IEnumerable GetDataDescriptors();
+
+ public abstract TData LoadData(IDataDescriptor descriptor);
+
+ public virtual bool CanImportData {
+ get { return false; }
+ }
+ public virtual TData ImportData(string path) {
+ throw new NotSupportedException();
+ }
+
+ public virtual bool CanExportData {
+ get { return false; }
+ }
+ public virtual void ExportData(TData instance, string path) {
+ throw new NotSupportedException();
+ }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Properties/AssemblyInfo.cs.frame (revision 16827)
@@ -0,0 +1,57 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.Problems.Instances")]
+[assembly: AssemblyDescription("Base plugin for making problem instances available to problems.")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HEAL")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2018 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("7c14407e-6980-465b-ba3a-4a916d48989b")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.3.0.0")]
+[assembly: AssemblyFileVersion("3.3.15.$WCREV$")]
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/ATSPData.cs (revision 16827)
@@ -0,0 +1,63 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 {
+ ///
+ /// Describe instances of the Asymmetric Traveling Salesman Problem (ATSP).
+ ///
+ public class ATSPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number of cities.
+ ///
+ public int Dimension { get; set; }
+ ///
+ /// The distances are given in form of a distance matrix.
+ ///
+ public double[,] Distances { get; set; }
+ ///
+ /// Optional! A a matrix of dimension [N, 2] where each row is one of the cities
+ /// and the colmns represent x and y coordinates respectively.
+ ///
+ ///
+ /// The coordinates are for display purposes only.
+ ///
+ public double[,] Coordinates { get; set; }
+
+ ///
+ /// Optional! The best-known tour in path-encoding.
+ ///
+ public int[] BestKnownTour { get; set; }
+ ///
+ /// Optional! The quality of the best-known tour.
+ ///
+ public double? BestKnownQuality { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/CTAPData.cs (revision 16827)
@@ -0,0 +1,70 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Capacitated Task Assignment Problem (CTAP).
+ ///
+ public class CTAPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number M of processors
+ ///
+ public int Processors { get; set; }
+ ///
+ /// The number N of tasks
+ ///
+ public int Tasks { get; set; }
+ ///
+ /// An MxN Matrix with M = |Processors| and N = |Tasks|
+ ///
+ public double[,] ExecutionCosts { get; set; }
+ ///
+ /// An NxN Matrix with N = |Tasks|
+ ///
+ public double[,] CommunicationCosts { get; set; }
+ ///
+ /// An array of length N with N = |Tasks|
+ ///
+ public double[] MemoryRequirements { get; set; }
+ ///
+ /// An array of length M with M = |Processors|
+ ///
+ public double[] MemoryCapacities { get; set; }
+
+ ///
+ /// Optional! An array of length N with N = |Tasks|
+ ///
+ public int[] BestKnownAssignment { get; set; }
+ ///
+ /// Optional! The quality value of the
+ ///
+ public double? BestKnownQuality { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/DistanceHelper.cs (revision 16827)
@@ -0,0 +1,133 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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
+
+using System;
+
+namespace HeuristicLab.Problems.Instances {
+ public enum DistanceMeasure { Direct, Euclidean, RoundedEuclidean, UpperEuclidean, Geo, Manhattan, Maximum, Att };
+
+ public static class DistanceHelper {
+ ///
+ /// If only the coordinates are given, can calculate the distance matrix.
+ ///
+ /// A full distance matrix between all cities.
+ public static double[,] GetDistanceMatrix(DistanceMeasure distanceMeasure, double[,] coordinates, double[,] distances, int dimension) {
+ if (distances != null) return distances;
+
+ distances = new double[dimension, dimension];
+ for (int i = 0; i < dimension - 1; i++)
+ for (int j = i + 1; j < dimension; j++) {
+ distances[i, j] = GetDistance(i, j, distanceMeasure, coordinates, distances);
+ distances[j, i] = distances[i, j];
+ }
+
+ return distances;
+ }
+
+ public static double GetDistance(DistanceMeasure distanceMeasure, double x1, double y1, double x2, double y2) {
+ switch (distanceMeasure) {
+ case DistanceMeasure.Att:
+ return AttDistance(x1, y1, x2, y2);
+ case DistanceMeasure.Direct:
+ throw new ArgumentException("Direct distance measure requires distance matrix for distance calculation.");
+ case DistanceMeasure.Euclidean:
+ return EuclideanDistance(x1, y1, x2, y2);
+ case DistanceMeasure.Geo:
+ return GeoDistance(x1, y1, x2, y2);
+ case DistanceMeasure.Manhattan:
+ return ManhattanDistance(x1, y1, x2, y2);
+ case DistanceMeasure.Maximum:
+ return MaximumDistance(x1, y1, x2, y2);
+ case DistanceMeasure.RoundedEuclidean:
+ return Math.Round(EuclideanDistance(x1, y1, x2, y2));
+ case DistanceMeasure.UpperEuclidean:
+ return Math.Ceiling(EuclideanDistance(x1, y1, x2, y2));
+ default:
+ throw new InvalidOperationException("Distance measure is not known.");
+ }
+ }
+
+ #region Private Helpers
+ private static double GetDistance(int i, int j, DistanceMeasure distanceMeasure, double[,] coordinates, double[,] distances) {
+ switch (distanceMeasure) {
+ case DistanceMeasure.Att:
+ return AttDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+ case DistanceMeasure.Direct:
+ return distances[i, j];
+ case DistanceMeasure.Euclidean:
+ return EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+ case DistanceMeasure.Geo:
+ return GeoDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+ case DistanceMeasure.Manhattan:
+ return ManhattanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+ case DistanceMeasure.Maximum:
+ return MaximumDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]);
+ case DistanceMeasure.RoundedEuclidean:
+ return Math.Round(EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]));
+ case DistanceMeasure.UpperEuclidean:
+ return Math.Ceiling(EuclideanDistance(coordinates[i, 0], coordinates[i, 1], coordinates[j, 0], coordinates[j, 1]));
+ default:
+ throw new InvalidOperationException("Distance measure is not known.");
+ }
+ }
+
+ private static double AttDistance(double x1, double y1, double x2, double y2) {
+ return Math.Ceiling(Math.Sqrt(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) / 10.0));
+ }
+
+ private static double EuclideanDistance(double x1, double y1, double x2, double y2) {
+ return Math.Sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
+ }
+
+ private const double PI = 3.141592;
+ private const double RADIUS = 6378.388;
+ private static double GeoDistance(double x1, double y1, double x2, double y2) {
+ double latitude1, longitude1, latitude2, longitude2;
+ double q1, q2, q3;
+ double length;
+
+ latitude1 = ConvertToRadian(x1);
+ longitude1 = ConvertToRadian(y1);
+ latitude2 = ConvertToRadian(x2);
+ longitude2 = ConvertToRadian(y2);
+
+ q1 = Math.Cos(longitude1 - longitude2);
+ q2 = Math.Cos(latitude1 - latitude2);
+ q3 = Math.Cos(latitude1 + latitude2);
+
+ length = (int)(RADIUS * Math.Acos(0.5 * ((1.0 + q1) * q2 - (1.0 - q1) * q3)) + 1.0);
+ return (length);
+ }
+
+ private static double ConvertToRadian(double x) {
+ return PI * (Math.Truncate(x) + 5.0 * (x - Math.Truncate(x)) / 3.0) / 180.0;
+ }
+
+ private static double ManhattanDistance(double x1, double y1, double x2, double y2) {
+ return Math.Round(Math.Abs(x1 - x2) + Math.Abs(y1 - y2), MidpointRounding.AwayFromZero);
+ }
+
+ private static double MaximumDistance(double x1, double y1, double x2, double y2) {
+ return Math.Max(Math.Round(Math.Abs(x1 - x2), MidpointRounding.AwayFromZero), Math.Round(Math.Abs(y1 - y2), MidpointRounding.AwayFromZero));
+ }
+ #endregion
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GCPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GCPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GCPData.cs (revision 16827)
@@ -0,0 +1,55 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 graph coloring problem (GCP).
+ ///
+ public class GCPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number of nodes in the graph
+ ///
+ public int Nodes { get; set; }
+ ///
+ /// An Nx2 adjacency list with N = Nodes
+ ///
+ public int[,] Adjacencies { get; set; }
+
+ ///
+ /// Optional! An array of length N with N = |Nodes|
+ ///
+ public int[] BestKnownColoring { get; set; }
+ ///
+ /// Optional! The least amount of colors that would not result in conflicts.
+ /// The amount of colors in if it is given as well.
+ ///
+ public int? BestKnownColors { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/GQAPData.cs (revision 16827)
@@ -0,0 +1,78 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 an instance of the Generalized Quadratic Assignment Problem (GQAP).
+ ///
+ public class GQAPData {
+ ///
+ /// The name of the instance.
+ ///
+ public string Name { get; set; }
+ ///
+ /// A description of the instance.
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// |E| = The number of equipments are to be assigned in this instance.
+ ///
+ public int Equipments { get; set; }
+ ///
+ /// |L| = The number of locations that are available for the equipments.
+ ///
+ public int Locations { get; set; }
+ ///
+ /// Vector of length |E| that describes the space demand for the equipments.
+ ///
+ public double[] Demands { get; set; }
+ ///
+ /// Vector of length |L| that describes the space capacity for the locations.
+ ///
+ public double[] Capacities { get; set; }
+ ///
+ /// |E|x|E| matrix with the weights (flows) between the equipments. These describe the strength of the respective bonding.
+ ///
+ public double[,] Weights { get; set; }
+ ///
+ /// |L|x|L| matrix with the distances between the locations.
+ ///
+ public double[,] Distances { get; set; }
+ ///
+ /// |E|x|L| matrix that describes the costs of installing equipment x at location y.
+ ///
+ public double[,] InstallationCosts { get; set; }
+ ///
+ /// A factor that scales the weights.
+ ///
+ public double TransportationCosts { get; set; }
+
+ ///
+ /// Optional! The best-known assignment is a vector of length |E| with numbers ranging from 0 to |L| - 1
+ ///
+ public int[] BestKnownAssignment { get; set; }
+ ///
+ /// Optional! The quality of the best-known assignment.
+ ///
+ public double? BestKnownQuality { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/JSSPData.cs (revision 16827)
@@ -0,0 +1,68 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Job Shop Scheduling Problem (JSSP).
+ ///
+ public class JSSPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number of jobs.
+ ///
+ public int Jobs { get; set; }
+ ///
+ /// The number of resources.
+ ///
+ public int Resources { get; set; }
+ ///
+ /// The first dimension lists the jobs, the second dimension the operations and the value denotes the processing time.
+ ///
+ public double[,] ProcessingTimes { get; set; }
+ ///
+ /// The first dimension lists the jobs, the second dimension the operations and the value denotes the resource that is demanded.
+ ///
+ public int[,] Demands { get; set; }
+ ///
+ /// Optional! Specifies the due dates for each job.
+ ///
+ public double[] DueDates { get; set; }
+
+ ///
+ /// Optional! The best-known schedule.
+ /// The first dimension lists the resources, the second dimension is the order and the value denotes the job
+ ///
+ public int[,] BestKnownSchedule { get; set; }
+ ///
+ /// Optional! The quality of the best-known schedule.
+ ///
+ public double? BestKnownQuality { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/OPData.cs (revision 16827)
@@ -0,0 +1,49 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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.Types {
+ ///
+ /// Describes instances of the Orienteering Problem (OP).
+ ///
+ public class OPData : TSPData {
+ ///
+ /// The maximum distance constraint for a Orienteering solution.
+ ///
+ public double MaximumDistance { get; set; }
+ ///
+ /// The scores of the points.
+ ///
+ public double[] Scores { get; set; }
+ ///
+ /// The penalty for each visited vertex.
+ ///
+ public double PointVisitingCosts { get; set; }
+ ///
+ /// Index of the starting point
+ ///
+ public int StartingPoint { get; set; }
+ ///
+ /// Index of the ending point.
+ ///
+ public int TerminalPoint { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/PTSPData.cs (revision 16827)
@@ -0,0 +1,12 @@
+
+namespace HeuristicLab.Problems.Instances {
+ ///
+ /// Describes instances of the Probabilistic Traveling Salesman Problem (PTSP).
+ ///
+ public class PTSPData : TSPData {
+ ///
+ /// The probabilities for each of the cities to appear in a route.
+ ///
+ public double[] Probabilities { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/QAPData.cs (revision 16827)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Quadratic Assignment Problem (QAP).
+ ///
+ public class QAPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number of facilities (and also the number of locations)
+ ///
+ public int Dimension { get; set; }
+ ///
+ /// An NxN Matrix with N = |Faciliies|
+ ///
+ public double[,] Distances { get; set; }
+ ///
+ /// An NxN Matrix with N = |Faciliies|
+ ///
+ public double[,] Weights { get; set; }
+
+ ///
+ /// Optional! An array of length N with N = |Facilities|
+ ///
+ public int[] BestKnownAssignment { get; set; }
+ ///
+ /// Optional! The quality value of the
+ ///
+ public double? BestKnownQuality { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/TSPData.cs (revision 16827)
@@ -0,0 +1,83 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Traveling Salesman Problem (TSP).
+ ///
+ public class TSPData {
+ ///
+ /// The name of the instance
+ ///
+ public string Name { get; set; }
+ ///
+ /// Optional! The description of the instance
+ ///
+ public string Description { get; set; }
+
+ ///
+ /// The number of cities.
+ ///
+ public int Dimension { get; set; }
+ ///
+ /// Specifies the distance measure that is to be used.
+ ///
+ public DistanceMeasure DistanceMeasure { get; set; }
+ ///
+ /// Optional! The distances are given in form of a distance matrix.
+ ///
+ ///
+ /// Either this property or needs to be specified.
+ ///
+ public double[,] Distances { get; set; }
+ ///
+ /// Optional! A a matrix of dimension [N, 2] matrix where each row is one of the cities
+ /// and the colmns represent x and y coordinates respectively.
+ ///
+ ///
+ /// Either this property or needs to be specified.
+ ///
+ /// If no distance matrix is given, the distances have to be calculated by the
+ /// specified distance measure. If a distance matrix is given in addtion to the
+ /// coordinates, the distance matrix takes precedence and the coordinates are
+ /// for display only.
+ ///
+ public double[,] Coordinates { get; set; }
+
+ ///
+ /// Optional! The best-known tour in path-encoding.
+ ///
+ public int[] BestKnownTour { get; set; }
+ ///
+ /// Optional! The quality of the best-known tour.
+ ///
+ 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);
+ }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPData.cs (revision 16827)
@@ -0,0 +1,33 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Capacitated Vehicle Routing Problem (CVRP).
+ ///
+ public class CVRPData: VRPData {
+ ///
+ /// The capacity of the vehicles, which is the same for all (homogeneous fleet).
+ ///
+ public double Capacity { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/CVRPTWData.cs (revision 16827)
@@ -0,0 +1,41 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Capacitated Vehicle Routing Problem with Time Windows (CVRPTW).
+ ///
+ public class CVRPTWData: CVRPData {
+ ///
+ /// The ready times of the customers and the depot
+ ///
+ public double[] ReadyTimes { get; set; }
+ ///
+ /// The service times of the customers and the depot
+ ///
+ public double[] ServiceTimes { get; set; }
+ ///
+ /// The due times of the customers and the depot
+ ///
+ public double[] DueTimes { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/IVRPData.cs (revision 16827)
@@ -0,0 +1,35 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 {
+ ///
+ /// Interface for VRP data
+ ///
+ public interface IVRPData {
+ string Name { get; set; }
+ string Description { get; set; }
+ int Dimension { get; set; }
+ double? BestKnownQuality { get; set; }
+ int[][] BestKnownTour { get; set; }
+ int[] BestKnownTourVehicleAssignment { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPData.cs (revision 16827)
@@ -0,0 +1,41 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Multi-Depot Capacitated Vehicle Routing Problem (MDCVRP).
+ ///
+ public class MDCVRPData: VRPData {
+ ///
+ /// The number of depots
+ ///
+ public int Depots { get; set; }
+ ///
+ /// The assignment of the vehicles to the depot.
+ ///
+ public int[] VehicleDepotAssignment { get; set; }
+ ///
+ /// The capacity of the vehicles, which is not the same for all (heterogeneous fleet).
+ ///
+ public double[] Capacity { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/MDCVRPTWData.cs (revision 16827)
@@ -0,0 +1,41 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Multi-Depot Capacitated Vehicle Routing Problem (MDCVRP).
+ ///
+ public class MDCVRPTWData: MDCVRPData {
+ ///
+ /// The ready times of the customers and the depot
+ ///
+ public double[] ReadyTimes { get; set; }
+ ///
+ /// The service times of the customers and the depot
+ ///
+ public double[] ServiceTimes { get; set; }
+ ///
+ /// The due times of the customers and the depot
+ ///
+ public double[] DueTimes { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/PDPTWData.cs (revision 16827)
@@ -0,0 +1,33 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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 Pickup and Delivery Problem with Time Windows (PDPTW).
+ ///
+ public class PDPTWData: CVRPTWData {
+ ///
+ /// The pickup and delivery locations of the requests
+ ///
+ public int[] PickupDeliveryLocations { get; set; }
+ }
+}
Index: /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs
===================================================================
--- /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs (revision 16827)
+++ /branches/2864_PermutationProblems/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs (revision 16827)
@@ -0,0 +1,96 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2019 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);
+ }
+ }
+}