Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11334


Ignore:
Timestamp:
09/02/14 15:52:33 (10 years ago)
Author:
pfleck
Message:

#2226 Merged r11280, r11282, r11292, r11294, r11295 and r11296 into stable.

Location:
stable
Files:
2 deleted
9 edited
4 copied

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauFormatInstanceProvider.cs

    r11333 r11334  
    2323
    2424namespace HeuristicLab.Problems.Instances.VehicleRouting {
    25   public abstract class CordeauFormatInstanceProvider : VRPInstanceProvider<MDCVRPTWData> {
    26     protected override MDCVRPTWData LoadData(Stream stream) {
     25  public abstract class CordeauFormatInstanceProvider<T> : VRPInstanceProvider<T> where T : MDCVRPData {
     26    protected override T LoadData(Stream stream) {
    2727      return LoadInstance(new CordeauParser(stream));
    2828    }
     
    3131      get { return true; }
    3232    }
    33     public override MDCVRPTWData ImportData(string path) {
     33    public override T ImportData(string path) {
    3434      return LoadInstance(new CordeauParser(path));
    3535    }
    3636
    37     private MDCVRPTWData LoadInstance(CordeauParser parser) {
    38       parser.Parse();
    39 
    40       var instance = new MDCVRPTWData();
    41       instance.Dimension = parser.Cities + 1;
    42       instance.Depots = parser.Depots;
    43       instance.Coordinates = parser.Coordinates;
    44       instance.Capacity = parser.Capacity;
    45       instance.Demands = parser.Demands;
    46       instance.DistanceMeasure = DistanceMeasure.Euclidean;
    47       instance.ReadyTimes = parser.Readytimes;
    48       instance.ServiceTimes = parser.Servicetimes;
    49       instance.DueTimes = parser.Duetimes;
    50       instance.MaximumVehicles = parser.Vehicles;
    51 
    52       int depots = parser.Depots;
    53       int vehicles = parser.Vehicles / parser.Depots;
    54       instance.VehicleDepotAssignment = new int[depots * vehicles];
    55       int index = 0;
    56 
    57       for (int i = 0; i < depots; i++)
    58         for (int j = 0; j < vehicles; j++) {
    59           instance.VehicleDepotAssignment[index] = i;
    60           index++;
    61         }
    62 
    63       instance.Name = parser.ProblemName;
    64 
    65       return instance;
    66     }
     37    internal abstract T LoadInstance(CordeauParser parser);
    6738  }
    6839}
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj

    r8624 r11334  
    103103  <ItemGroup>
    104104    <Reference Include="ICSharpCode.SharpZipLib">
    105     <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
    106     <Private>False</Private>
    107   </Reference>
     105      <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath>
     106      <Private>False</Private>
     107    </Reference>
    108108    <Reference Include="System" />
    109109    <Reference Include="System.Core" />
     
    111111  </ItemGroup>
    112112  <ItemGroup>
     113    <Compile Include="CordeauFormat\CordeauMDTWInstanceProvider.cs" />
    113114    <Compile Include="GoldenFormat\ChristofidesInstanceProvider.cs" />
    114115    <Compile Include="GoldenFormat\KytojokiInstanceProvider.cs" />
     
    122123    <Compile Include="TSPLibFormat\AugeratInstanceProvider.cs" />
    123124    <Compile Include="TSPLibFormat\ChristofidesEilonInstanceProvider.cs" />
    124     <Compile Include="CordeauFormat\CordeauInstanceProvider.cs" />
     125    <Compile Include="CordeauFormat\CordeauMDInstanceProvider.cs" />
    125126    <Compile Include="CordeauFormat\CordeauFormatInstanceProvider.cs" />
    126127    <Compile Include="LiLimFormat\LiLimInstanceProvider.cs" />
     
    142143    <EmbeddedResource Include="Data\Homberger.zip" />
    143144    <EmbeddedResource Include="Data\LiLim.zip" />
    144     <EmbeddedResource Include="Data\Cordeau.zip" />
    145145    <EmbeddedResource Include="Data\Golden.zip" />
    146146    <EmbeddedResource Include="Data\Christofides.zip" />
     
    148148    <EmbeddedResource Include="Data\Taillard.opt.zip" />
    149149    <EmbeddedResource Include="Data\Taillard.zip" />
     150    <EmbeddedResource Include="Data\CordeauMD.zip" />
     151    <EmbeddedResource Include="Data\CordeauMDTW.zip" />
    150152    <None Include="Plugin.cs.frame" />
    151153    <Compile Include="Plugin.cs" />
     
    180182  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    181183  <PropertyGroup>
    182    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
     184    <PreBuildEvent Condition=" '$(OS)' == 'Windows_NT' ">set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
    183185set ProjectDir=$(ProjectDir)
    184186set SolutionDir=$(SolutionDir)
     
    186188
    187189call PreBuildEvent.cmd</PreBuildEvent>
    188 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
     190    <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">
    189191export ProjectDir=$(ProjectDir)
    190192export SolutionDir=$(SolutionDir)
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimInstanceProvider.cs

    r11170 r11334  
    3737      get { return "LiLim test set"; }
    3838    }
    39    
     39
    4040    public override Uri WebLink {
    41       get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/Problems/PDPTW/Li--Lim-benchmark/"); }
     41      get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/PDPTW/Li--Lim-benchmark/"); }
    4242    }
    4343
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/HombergerInstanceProvider.cs

    r11170 r11334  
    3737      get { return "Homberger test set"; }
    3838    }
    39    
     39
    4040    public override Uri WebLink {
    41       get { return new Uri(@"http://www.fernuni-hagen.de/WINF/touren/inhalte/probinst.htm"); }
     41      get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/VRPTW/Homberger-benchmark/"); }
    4242    }
    4343
  • stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs

    r11333 r11334  
    9393            routes.Add(route);
    9494          }
     95
     96          if (line.StartsWith("Solution")) {
     97            if (routes.Any()) {
     98              // Skip remaining solutions since only one "best solution" is stored
     99              break;
     100            }
     101          }
    95102        }
    96103      }
Note: See TracChangeset for help on using the changeset viewer.