Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/10/14 10:31:41 (10 years ago)
Author:
pfleck
Message:

#2269 Merged trunk. Updated .net version of ALPS plugin.

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  
    1111    <RootNamespace>HeuristicLab.Problems.Instances.VehicleRouting</RootNamespace>
    1212    <AssemblyName>HeuristicLab.Problems.Instances.VehicleRouting-3.4</AssemblyName>
    13     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     13    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
    1414    <FileAlignment>512</FileAlignment>
     15    <TargetFrameworkProfile />
    1516  </PropertyGroup>
    1617  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     
    2223    <ErrorReport>prompt</ErrorReport>
    2324    <WarningLevel>4</WarningLevel>
     25    <Prefer32Bit>false</Prefer32Bit>
    2426  </PropertyGroup>
    2527  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     
    3032    <ErrorReport>prompt</ErrorReport>
    3133    <WarningLevel>4</WarningLevel>
     34    <Prefer32Bit>false</Prefer32Bit>
    3235  </PropertyGroup>
    3336  <PropertyGroup>
     
    5255    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    5356    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     57    <Prefer32Bit>false</Prefer32Bit>
    5458  </PropertyGroup>
    5559  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
     
    6872    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    6973    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     74    <Prefer32Bit>false</Prefer32Bit>
    7075  </PropertyGroup>
    7176  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
     
    8489    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    8590    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
     91    <Prefer32Bit>false</Prefer32Bit>
    8692  </PropertyGroup>
    8793  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
     
    100106    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
    101107    <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>
    108111    <Reference Include="System" />
    109112    <Reference Include="System.Core" />
    110113    <Reference Include="System.Data" />
     114    <Reference Include="System.IO.Compression" />
    111115  </ItemGroup>
    112116  <ItemGroup>
  • branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimInstanceProvider.cs

    r11280 r11677  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
  • branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/HombergerInstanceProvider.cs

    r11280 r11677  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
  • branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonInstanceProvider.cs

    r11171 r11677  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
     
    3731      get { return "Solomon test set"; }
    3832    }
    39    
     33
    4034    public override Uri WebLink {
    4135      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  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
     
    3731      get { return "Augerat test set"; }
    3832    }
    39    
     33
    4034    public override Uri WebLink {
    4135      get { return new Uri(@"http://www.branchandcut.org/VRP/data"); }
  • branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TSPLibFormat/ChristofidesEilonInstanceProvider.cs

    r11171 r11677  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
     
    3731      get { return "Christofides and Eilon test set"; }
    3832    }
    39    
     33
    4034    public override Uri WebLink {
    4135      get { return new Uri(@"http://www.branchandcut.org/VRP/data"); }
  • branches/ALPS/HeuristicLab.Problems.Instances.VehicleRouting/3.4/TaillardFormat/TaillardInstanceProvider.cs

    r11171 r11677  
    2121
    2222using 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;
    2923
    3024namespace HeuristicLab.Problems.Instances.VehicleRouting {
     
    3731      get { return "Taillard test set"; }
    3832    }
    39    
     33
    4034    public override Uri WebLink {
    4135      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  
    2323using System.Collections.Generic;
    2424using System.IO;
     25using System.IO.Compression;
    2526using System.Linq;
    2627using System.Reflection;
    2728using System.Text.RegularExpressions;
    2829using HeuristicLab.Common;
    29 using ICSharpCode.SharpZipLib.Zip;
    3030
    3131namespace HeuristicLab.Problems.Instances.VehicleRouting {
     
    3737      var solutionsArchiveName = GetResourceName(FileName + @"\.opt\.zip");
    3838      if (!String.IsNullOrEmpty(solutionsArchiveName)) {
    39         using (var solutionsZipFile = new ZipInputStream(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);
    4242        }
    4343      }
     
    4545      if (String.IsNullOrEmpty(instanceArchiveName)) yield break;
    4646
    47       using (var instanceStream = new ZipInputStream(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())) {
    4949          string solutionEntry = Path.GetFileNameWithoutExtension(entry) + "." + FileName;
    5050          yield return new VRPDataDescriptor(Path.GetFileNameWithoutExtension(entry), GetInstanceDescription(), entry, solutions.ContainsKey(solutionEntry) ? solutions[solutionEntry] : String.Empty);
     
    5656      var descriptor = (VRPDataDescriptor)id;
    5757      var instanceArchiveName = GetResourceName(FileName + @"\.zip");
    58       using (var instancesZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
     58      using (var instancesZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(instanceArchiveName))) {
    5959        var entry = instancesZipFile.GetEntry(descriptor.InstanceIdentifier);
    60         var stream = instancesZipFile.GetInputStream(entry);
     60        var stream = entry.Open();
    6161        var instance = LoadData(stream);
    6262        if (string.IsNullOrEmpty(instance.Name)) {
     
    6666        if (!String.IsNullOrEmpty(descriptor.SolutionIdentifier)) {
    6767          var solutionsArchiveName = GetResourceName(FileName + @"\.opt\.zip");
    68           using (var solutionsZipFile = new ZipFile(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
     68          using (var solutionsZipFile = new ZipArchive(GetType().Assembly.GetManifestResourceStream(solutionsArchiveName))) {
    6969            entry = solutionsZipFile.GetEntry(descriptor.SolutionIdentifier);
    70             stream = solutionsZipFile.GetInputStream(entry);
     70            stream = entry.Open();
    7171            LoadSolution(stream, instance);
    7272          }
     
    130130          LoadSolution(stream, instance);
    131131        }
    132       } catch (Exception) {
     132      }
     133      catch (Exception) {
    133134        // new stream necessary because first try already read from stream
    134135        using (var stream = new FileStream(path, FileMode.Open)) {
     
    149150      return "Embedded instance of plugin version " + Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).Cast<AssemblyFileVersionAttribute>().First().Version + ".";
    150151    }
    151 
    152     protected IEnumerable<string> GetZipContents(ZipInputStream zipFile) {
    153       ZipEntry entry;
    154       while ((entry = zipFile.GetNextEntry()) != null) {
    155         yield return entry.Name;
    156       }
    157     }
    158152    #endregion
    159153  }
Note: See TracChangeset for help on using the changeset viewer.