- Timestamp:
- 08/20/14 09:30:37 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
/trunk/sources merged: 11285-11287
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.Instances merged: 11285
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauFormatInstanceProvider.cs
r11185 r11289 23 23 24 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { 25 public abstract class CordeauFormatInstanceProvider : VRPInstanceProvider {26 protected override VRPData LoadData(Stream stream) {25 public abstract class CordeauFormatInstanceProvider : VRPInstanceProvider<MDCVRPTWData> { 26 protected override MDCVRPTWData LoadData(Stream stream) { 27 27 return LoadInstance(new CordeauParser(stream)); 28 28 } … … 31 31 get { return true; } 32 32 } 33 public override VRPData ImportData(string path) {33 public override MDCVRPTWData ImportData(string path) { 34 34 return LoadInstance(new CordeauParser(path)); 35 35 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/GoldenFormat/GoldenFormatInstanceProvider.cs
r11185 r11289 24 24 25 25 namespace HeuristicLab.Problems.Instances.VehicleRouting { 26 public abstract class GoldenFormatInstanceProvider : VRPInstanceProvider {27 protected override VRPData LoadData(Stream stream) {26 public abstract class GoldenFormatInstanceProvider : VRPInstanceProvider<CVRPTWData> { 27 protected override CVRPTWData LoadData(Stream stream) { 28 28 return LoadInstance(new GoldenParser(stream)); 29 29 } … … 32 32 get { return true; } 33 33 } 34 public override VRPData ImportData(string path) {34 public override CVRPTWData ImportData(string path) { 35 35 return LoadInstance(new GoldenParser(path)); 36 36 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimFormatInstanceProvider.cs
r11185 r11289 23 23 24 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { 25 public abstract class LiLimFormatInstanceProvider : VRPInstanceProvider {26 protected override VRPData LoadData(Stream stream) {25 public abstract class LiLimFormatInstanceProvider : VRPInstanceProvider<PDPTWData> { 26 protected override PDPTWData LoadData(Stream stream) { 27 27 return LoadInstance(new LiLimParser(stream)); 28 28 } … … 31 31 get { return true; } 32 32 } 33 public override VRPData ImportData(string path) {33 public override PDPTWData ImportData(string path) { 34 34 return LoadInstance(new LiLimParser(path)); 35 35 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonFormatInstanceProvider.cs
r11185 r11289 23 23 24 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { 25 public abstract class SolomonFormatInstanceProvider : VRPInstanceProvider {26 protected override VRPData LoadData(Stream stream) {25 public abstract class SolomonFormatInstanceProvider : VRPInstanceProvider<CVRPTWData> { 26 protected override CVRPTWData LoadData(Stream stream) { 27 27 return LoadInstance(new SolomonParser(stream)); 28 28 } … … 31 31 get { return true; } 32 32 } 33 public override VRPData ImportData(string path) {33 public override CVRPTWData ImportData(string path) { 34 34 return LoadInstance(new SolomonParser(path)); 35 35 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TSPLibFormat/TSPLibFormatInstanceProvider.cs
r11185 r11289 25 25 26 26 namespace HeuristicLab.Problems.Instances.VehicleRouting { 27 public abstract class TSPLibFormatInstanceProvider : VRPInstanceProvider {28 protected override VRPData LoadData(Stream stream) {27 public abstract class TSPLibFormatInstanceProvider : VRPInstanceProvider<CVRPData> { 28 protected override CVRPData LoadData(Stream stream) { 29 29 return LoadInstance(new TSPLIBParser(stream)); 30 30 } … … 33 33 get { return true; } 34 34 } 35 public override VRPData ImportData(string path) {35 public override CVRPData ImportData(string path) { 36 36 return LoadInstance(new TSPLIBParser(path)); 37 37 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TaillardFormat/TaillardFormatInstanceProvider.cs
r11185 r11289 23 23 24 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { 25 public abstract class TaillardFormatInstanceProvider : VRPInstanceProvider {26 protected override VRPData LoadData(Stream stream) {25 public abstract class TaillardFormatInstanceProvider : VRPInstanceProvider<CVRPData> { 26 protected override CVRPData LoadData(Stream stream) { 27 27 return LoadInstance(new TaillardParser(stream)); 28 28 } … … 31 31 get { return true; } 32 32 } 33 public override VRPData ImportData(string path) {33 public override CVRPData ImportData(string path) { 34 34 return LoadInstance(new TaillardParser(path)); 35 35 } -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs
r11185 r11289 29 29 30 30 namespace HeuristicLab.Problems.Instances.VehicleRouting { 31 public abstract class VRPInstanceProvider : ProblemInstanceProvider<VRPData>, IVRPInstanceProvider{31 public abstract class VRPInstanceProvider<T> : ProblemInstanceProvider<T>, IVRPInstanceProvider where T : IVRPData { 32 32 protected abstract string FileName { get; } 33 33 … … 52 52 } 53 53 54 public override VRPDataLoadData(IDataDescriptor id) {54 public override T LoadData(IDataDescriptor id) { 55 55 var descriptor = (VRPDataDescriptor)id; 56 56 var instanceArchiveName = GetResourceName(FileName + @"\.zip"); … … 76 76 } 77 77 78 private static void LoadSolution(Stream stream, VRPDatainstance) {78 private static void LoadSolution(Stream stream, T instance) { 79 79 List<List<int>> routes = new List<List<int>>(); 80 80 … … 99 99 } 100 100 101 public static void LoadSolution(string path, VRPDatainstance) {101 public static void LoadSolution(string path, T instance) { 102 102 using (FileStream stream = new FileStream(path, FileMode.Open)) { 103 103 LoadSolution(stream, instance); … … 105 105 } 106 106 107 protected abstract VRPDataLoadData(Stream stream);107 protected abstract T LoadData(Stream stream); 108 108 109 109 public IVRPData Import(string vrpFile, string tourFile) { … … 116 116 117 117 public void Export(IVRPData instance, string path) { 118 ExportData(( VRPData)instance, path);118 ExportData((T)instance, path); 119 119 } 120 120 -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances/3.3/IProblemInstanceConsumer.cs
r11185 r11289 25 25 public interface IProblemInstanceConsumer : IContent { } 26 26 27 public interface IProblemInstanceConsumer< TData> : IProblemInstanceConsumer {27 public interface IProblemInstanceConsumer<in TData> : IProblemInstanceConsumer { 28 28 /// <summary> 29 29 /// Loads the given instance data. -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Instances/3.3/Types/VRP/VRPData.cs
r11185 r11289 25 25 /// Describes instances of the Vehicle Routing Problem (VRP). 26 26 /// </summary> 27 public abstract class VRPData: IVRPData {27 public class VRPData : IVRPData { 28 28 /// <summary> 29 29 /// The name of the instance -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 11285
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r11185 r11289 42 42 [Creatable("Problems")] 43 43 [StorableClass] 44 public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer< VRPData> {44 public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> { 45 45 public string Filename { get; set; } 46 46 … … 390 390 #region IProblemInstanceConsumer<VRPData> Members 391 391 392 public void Load( VRPData data) {392 public void Load(IVRPData data) { 393 393 var interpreterDataType = data.GetType(); 394 394 var interpreterType = typeof(IVRPDataInterpreter<>).MakeGenericType(interpreterDataType); -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Tests
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Tests merged: 11287
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Tests/HeuristicLab.Problems.VehicleRouting-3.4/VRPInstancesTest.cs
r11185 r11289 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using System.Text; 25 using HeuristicLab.P luginInfrastructure;26 using HeuristicLab. Problems.Instances.VehicleRouting;26 using HeuristicLab.Problems.Instances; 27 using HeuristicLab.Tests; 27 28 using Microsoft.VisualStudio.TestTools.UnitTesting; 28 29 … … 30 31 [TestClass] 31 32 public class VRPInstancesTest { 33 [ClassInitialize] 34 public static void MyClassInitialize(TestContext testContext) { 35 PluginLoader.Assemblies.Any(); 36 } 37 32 38 [TestMethod] 33 39 [TestCategory("Problems.VehicleRouting")] 34 40 [TestProperty("Time", "long")] 35 41 public void TestVRPInstances() { 36 var providers = ApplicationManager.Manager.GetInstances<VRPInstanceProvider>();37 42 var vrp = new VehicleRoutingProblem(); 43 var providers = ProblemInstanceManager.GetProviders(vrp); 38 44 var failedInstances = new StringBuilder(); 39 45 … … 41 47 42 48 foreach (var provider in providers) { 43 var instances = provider.GetDataDescriptors();49 IEnumerable<IDataDescriptor> instances = ((dynamic)provider).GetDataDescriptors(); 44 50 Assert.IsTrue(instances.Any(), "No instances could be found."); 45 51 … … 47 53 try { 48 54 // throws InvalidOperationException if zero or more than one interpreter is found 49 vrp.Load(provider.LoadData(instance));55 ((dynamic)vrp).Load(((dynamic)provider).LoadData(instance)); 50 56 } catch (Exception exc) { 51 57 failedInstances.AppendLine(instance + ": " + exc.Message); -
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Tests/HeuristicLab.Tests.csproj
r11091 r11289 330 330 <Private>False</Private> 331 331 </Reference> 332 <Reference Include="Microsoft.CSharp" /> 332 333 <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> 333 334 <Private>false</Private>
Note: See TracChangeset
for help on using the changeset viewer.