- Timestamp:
- 12/10/14 10:31:41 (10 years ago)
- Location:
- branches/ALPS
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS
-
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj
r11478 r11677 11 11 <RootNamespace>HeuristicLab.Problems.Instances.VehicleRouting</RootNamespace> 12 12 <AssemblyName>HeuristicLab.Problems.Instances.VehicleRouting-3.4</AssemblyName> 13 <TargetFrameworkVersion>v4. 0</TargetFrameworkVersion>13 <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> 14 14 <FileAlignment>512</FileAlignment> 15 <TargetFrameworkProfile /> 15 16 </PropertyGroup> 16 17 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> … … 22 23 <ErrorReport>prompt</ErrorReport> 23 24 <WarningLevel>4</WarningLevel> 25 <Prefer32Bit>false</Prefer32Bit> 24 26 </PropertyGroup> 25 27 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> … … 30 32 <ErrorReport>prompt</ErrorReport> 31 33 <WarningLevel>4</WarningLevel> 34 <Prefer32Bit>false</Prefer32Bit> 32 35 </PropertyGroup> 33 36 <PropertyGroup> … … 52 55 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 53 56 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 57 <Prefer32Bit>false</Prefer32Bit> 54 58 </PropertyGroup> 55 59 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> … … 68 72 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 69 73 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 74 <Prefer32Bit>false</Prefer32Bit> 70 75 </PropertyGroup> 71 76 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> … … 84 89 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 85 90 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 91 <Prefer32Bit>false</Prefer32Bit> 86 92 </PropertyGroup> 87 93 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> … … 100 106 <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories> 101 107 <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules> 102 </PropertyGroup> 103 <ItemGroup> 104 <Reference Include="ICSharpCode.SharpZipLib"> 105 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath> 106 <Private>False</Private> 107 </Reference> 108 <Prefer32Bit>false</Prefer32Bit> 109 </PropertyGroup> 110 <ItemGroup> 108 111 <Reference Include="System" /> 109 112 <Reference Include="System.Core" /> 110 113 <Reference Include="System.Data" /> 114 <Reference Include="System.IO.Compression" /> 111 115 </ItemGroup> 112 116 <ItemGroup> -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimInstanceProvider.cs
r11280 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/HombergerInstanceProvider.cs
r11280 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonInstanceProvider.cs
r11171 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { … … 37 31 get { return "Solomon test set"; } 38 32 } 39 33 40 34 public override Uri WebLink { 41 35 get { return new Uri(@"http://web.cba.neu.edu/~msolomon/problems.htm"); } -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TSPLibFormat/AugeratInstanceProvider.cs
r11171 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { … … 37 31 get { return "Augerat test set"; } 38 32 } 39 33 40 34 public override Uri WebLink { 41 35 get { return new Uri(@"http://www.branchandcut.org/VRP/data"); } -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TSPLibFormat/ChristofidesEilonInstanceProvider.cs
r11171 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { … … 37 31 get { return "Christofides and Eilon test set"; } 38 32 } 39 33 40 34 public override Uri WebLink { 41 35 get { return new Uri(@"http://www.branchandcut.org/VRP/data"); } -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TaillardFormat/TaillardInstanceProvider.cs
r11171 r11677 21 21 22 22 using System; 23 using System.Collections.Generic;24 using System.IO;25 using System.Linq;26 using System.Reflection;27 using System.Text.RegularExpressions;28 using ICSharpCode.SharpZipLib.Zip;29 23 30 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { … … 37 31 get { return "Taillard test set"; } 38 32 } 39 33 40 34 public override Uri WebLink { 41 35 get { return new Uri(@"http://mistic.heig-vd.ch/taillard/problemes.dir/vrp.dir/vrp.html"); } -
branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs
r11478 r11677 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using System.IO.Compression; 25 26 using System.Linq; 26 27 using System.Reflection; 27 28 using System.Text.RegularExpressions; 28 29 using HeuristicLab.Common; 29 using ICSharpCode.SharpZipLib.Zip;30 30 31 31 namespace HeuristicLab.Problems.Instances.VehicleRouting { … … 37 37 var solutionsArchiveName = GetResourceName(FileName + @"\.opt\.zip"); 38 38 if (!String.IsNullOrEmpty(solutionsArchiveName)) { 39 using (var solutionsZipFile = new Zip InputStream(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {40 foreach (var entry in GetZipContents(solutionsZipFile))41 solutions.Add(Path.GetFileNameWithoutExtension(entry ) + "." + FileName, entry);39 using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName), ZipArchiveMode.Read)) { 40 foreach (var entry in solutionsZipFile.Entries) 41 solutions.Add(Path.GetFileNameWithoutExtension(entry.Name) + "." + FileName, entry.Name); 42 42 } 43 43 } … … 45 45 if (String.IsNullOrEmpty(instanceArchiveName)) yield break; 46 46 47 using (var instanceStream = new Zip InputStream(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {48 foreach (var entry in GetZipContents(instanceStream).OrderBy(x => x, new NaturalStringComparer())) {47 using (var instanceStream = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName), ZipArchiveMode.Read)) { 48 foreach (var entry in instanceStream.Entries.Select(x => x.Name).OrderBy(x => x, new NaturalStringComparer())) { 49 49 string solutionEntry = Path.GetFileNameWithoutExtension(entry) + "." + FileName; 50 50 yield return new VRPDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetInstanceDescription(), entry, solutions.ContainsKey(solutionEntry) ? solutions[solutionEntry] : String.Empty); … … 56 56 var descriptor = (VRPDataDescriptor)id; 57 57 var instanceArchiveName = GetResourceName(FileName + @"\.zip"); 58 using (var instancesZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {58 using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) { 59 59 var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier); 60 var stream = instancesZipFile.GetInputStream(entry);60 var stream = entry.Open(); 61 61 var instance = LoadData(stream); 62 62 if (string.IsNullOrEmpty(instance.Name)) { … … 66 66 if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) { 67 67 var solutionsArchiveName = GetResourceName(FileName + @"\.opt\.zip"); 68 using (var solutionsZipFile = new Zip File(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {68 using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) { 69 69 entry = solutionsZipFile.GetEntry(descriptor.SolutionIdentifier); 70 stream = solutionsZipFile.GetInputStream(entry);70 stream = entry.Open(); 71 71 LoadSolution(stream, instance); 72 72 } … … 130 130 LoadSolution(stream, instance); 131 131 } 132 } catch (Exception) { 132 } 133 catch (Exception) { 133 134 // new stream necessary because first try already read from stream 134 135 using (var stream = new FileStream(path, FileMode.Open)) { … … 149 150 return "Embedded instance of plugin version " + Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).Cast<AssemblyFileVersionAttribute>().First().Version + "."; 150 151 } 151 152 protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {153 ZipEntry entry;154 while ((entry = zipFile.GetNextEntry()) != null) {155 yield return entry.Name;156 }157 }158 152 #endregion 159 153 }
Note: See TracChangeset
for help on using the changeset viewer.