Changeset 15973 for branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3
- Timestamp:
- 06/28/18 11:13:37 (6 years ago)
- Location:
- branches/2522_RefactorPluginInfrastructure
- Files:
-
- 10 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/2522_RefactorPluginInfrastructure
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/HeuristicLab.Problems.Instances.TSPLIB-3.3.csproj
r11650 r15973 115 115 </ItemGroup> 116 116 <ItemGroup> 117 <Compile Include="TSPLIBHeterogeneousPTSPDataDescriptor.cs" /> 118 <Compile Include="TSPLIBHomogeneousPTSPDataDescriptor.cs" /> 119 <Compile Include="TSPLIBHeterogeneousPTSPInstanceProvider.cs" /> 120 <Compile Include="TSPLIBPTSPInstanceProvider.cs" /> 117 121 <Compile Include="TSPLIBInstanceProvider.cs" /> 118 122 <Compile Include="TSPLIBATSPInstanceProvider.cs" /> 119 123 <Compile Include="TSPLIBCVRPInstanceProvider.cs" /> 120 124 <Compile Include="TSPLIBDataDescriptor.cs" /> 125 <Compile Include="TSPLIBHomogeneousPTSPInstanceProvider.cs" /> 121 126 <Compile Include="TSPLIBTSPInstanceProvider.cs" /> 122 127 <Compile Include="TSPLIBParser.cs" /> … … 125 130 <EmbeddedResource Include="Data\tsp.opt.tour.zip" /> 126 131 <EmbeddedResource Include="Data\vrp.zip" /> 132 <EmbeddedResource Include="Data\tsp.qual" /> 133 <EmbeddedResource Include="Data\atsp.qual" /> 127 134 <None Include="Plugin.cs.frame" /> 128 135 <Compile Include="Plugin.cs" /> … … 150 157 </ProjectReference> 151 158 </ItemGroup> 152 <ItemGroup />153 159 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 154 160 <PropertyGroup> -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/Plugin.cs.frame
r13321 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Problems.Instances.TSPLIB { 25 [Plugin("HeuristicLab.Problems.Instances.TSPLIB", "3.3.1 3.$WCREV$")]25 [Plugin("HeuristicLab.Problems.Instances.TSPLIB", "3.3.15.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.Instances.TSPLIB-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/Properties/AssemblyInfo.cs.frame
r13321 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2018 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.15.$WCREV$")] -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBATSPInstanceProvider.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 36 36 protected override string FileExtension { get { return "atsp"; } } 37 37 38 protected override ATSPData LoadInstance(TSPLIBParser parser ) {38 protected override ATSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) { 39 39 var instance = new ATSPData(); 40 40 … … 56 56 instance.BestKnownTour = parser.Tour.FirstOrDefault(); 57 57 } 58 59 protected override void LoadQuality(double? bestQuality, ATSPData instance) { 60 instance.BestKnownQuality = bestQuality; 61 } 58 62 } 59 63 } -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBCVRPInstanceProvider.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 36 36 protected override string FileExtension { get { return "vrp"; } } 37 37 38 protected override CVRPData LoadInstance(TSPLIBParser parser ) {38 protected override CVRPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) { 39 39 parser.Parse(); 40 40 var instance = new CVRPData(); … … 78 78 instance.BestKnownTour = parser.Tour; 79 79 } 80 81 protected override void LoadQuality(double? bestQuality, CVRPData instance) { 82 instance.BestKnownQuality = bestQuality; 83 } 80 84 } 81 85 } -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBDataDescriptor.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 27 27 internal string InstanceIdentifier { get; set; } 28 28 internal string SolutionIdentifier { get; set; } 29 internal double? BestQuality { get; set; } 29 30 30 internal TSPLIBDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier ) {31 internal TSPLIBDataDescriptor(string name, string description, string instanceIdentifier, string solutionIdentifier, double? bestQuality) { 31 32 this.Name = name; 32 33 this.Description = description; 33 34 this.InstanceIdentifier = instanceIdentifier; 34 35 this.SolutionIdentifier = solutionIdentifier; 36 this.BestQuality = bestQuality; 35 37 } 36 38 } -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBInstanceProvider.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 45 45 protected abstract string FileExtension { get; } 46 46 47 protected abstract T LoadInstance(TSPLIBParser parser );47 protected abstract T LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null); 48 48 protected abstract void LoadSolution(TSPLIBParser parser, T instance); 49 protected abstract void LoadQuality(double? bestQuality, T instance); 49 50 50 51 public override IEnumerable<IDataDescriptor> GetDataDescriptors() { … … 57 58 } 58 59 } 60 61 Dictionary<string, double> qualities = new Dictionary<string, double>(); 62 var qualitiesArchiveName = GetResourceName(FileExtension + @"\.qual"); 63 if (!String.IsNullOrEmpty(qualitiesArchiveName)) { 64 using (var qualitiesReader = new StreamReader(GetType().Assembly.GetManifestResourceStream(qualitiesArchiveName))) { 65 while (!qualitiesReader.EndOfStream) { 66 var line = qualitiesReader.ReadLine().Split(';'); 67 qualities.Add(line[0] + "." + FileExtension, double.Parse(line[1])); 68 } 69 } 70 } 71 59 72 var instanceArchiveName = GetResourceName(FileExtension + @"\.zip"); 60 73 if (String.IsNullOrEmpty(instanceArchiveName)) yield break; … … 62 75 using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 63 76 foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x)) { 64 yield return new TSPLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetInstanceDescription(), entry, solutions.ContainsKey(entry) ? solutions[entry] : String.Empty); 77 yield return new TSPLIBDataDescriptor(Path.GetFileNameWithoutExtension(entry), 78 GetInstanceDescription(), 79 entry, 80 solutions.ContainsKey(entry) ? solutions[entry] : String.Empty, 81 qualities.ContainsKey(entry) ? (double?)qualities[entry] : null); 65 82 } 66 83 } … … 74 91 var stream = entry.Open(); 75 92 var parser = new TSPLIBParser(stream); 76 var instance = LoadInstance(parser); 93 var instance = LoadInstance(parser, id); 94 LoadQuality(descriptor.BestQuality, instance); 77 95 78 96 if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) { -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBParser.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.Instances.TSPLIB/3.3/TSPLIBTSPInstanceProvider.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 37 37 protected override string FileExtension { get { return "tsp"; } } 38 38 39 protected override TSPData LoadInstance(TSPLIBParser parser ) {39 protected override TSPData LoadInstance(TSPLIBParser parser, IDataDescriptor descriptor = null) { 40 40 parser.Parse(); 41 41 if (parser.FixedEdges != null) throw new InvalidDataException("TSP instance " + parser.Name + " contains fixed edges which are not supported by HeuristicLab."); … … 81 81 } 82 82 83 protected override void LoadQuality(double? bestQuality, TSPData instance) { 84 instance.BestKnownQuality = bestQuality; 85 } 86 83 87 public TSPData LoadData(string tspFile, string tourFile, double? bestQuality) { 84 88 var data = LoadInstance(new TSPLIBParser(tspFile));
Note: See TracChangeset
for help on using the changeset viewer.