Changeset 11334 for stable/HeuristicLab.Problems.Instances.VehicleRouting
- Timestamp:
- 09/02/14 15:52:33 (10 years ago)
- Location:
- stable
- Files:
-
- 2 deleted
- 9 edited
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 11280,11282,11292,11294-11296
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauFormatInstanceProvider.cs
r11333 r11334 23 23 24 24 namespace HeuristicLab.Problems.Instances.VehicleRouting { 25 public abstract class CordeauFormatInstanceProvider : VRPInstanceProvider<MDCVRPTWData>{26 protected override MDCVRPTWDataLoadData(Stream stream) {25 public abstract class CordeauFormatInstanceProvider<T> : VRPInstanceProvider<T> where T : MDCVRPData { 26 protected override T LoadData(Stream stream) { 27 27 return LoadInstance(new CordeauParser(stream)); 28 28 } … … 31 31 get { return true; } 32 32 } 33 public override MDCVRPTWDataImportData(string path) {33 public override T ImportData(string path) { 34 34 return LoadInstance(new CordeauParser(path)); 35 35 } 36 36 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); 67 38 } 68 39 } -
stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj
r8624 r11334 103 103 <ItemGroup> 104 104 <Reference Include="ICSharpCode.SharpZipLib"> 105 106 107 105 <HintPath>..\..\HeuristicLab.PluginInfrastructure\3.3\ICSharpCode.SharpZipLib.dll</HintPath> 106 <Private>False</Private> 107 </Reference> 108 108 <Reference Include="System" /> 109 109 <Reference Include="System.Core" /> … … 111 111 </ItemGroup> 112 112 <ItemGroup> 113 <Compile Include="CordeauFormat\CordeauMDTWInstanceProvider.cs" /> 113 114 <Compile Include="GoldenFormat\ChristofidesInstanceProvider.cs" /> 114 115 <Compile Include="GoldenFormat\KytojokiInstanceProvider.cs" /> … … 122 123 <Compile Include="TSPLibFormat\AugeratInstanceProvider.cs" /> 123 124 <Compile Include="TSPLibFormat\ChristofidesEilonInstanceProvider.cs" /> 124 <Compile Include="CordeauFormat\Cordeau InstanceProvider.cs" />125 <Compile Include="CordeauFormat\CordeauMDInstanceProvider.cs" /> 125 126 <Compile Include="CordeauFormat\CordeauFormatInstanceProvider.cs" /> 126 127 <Compile Include="LiLimFormat\LiLimInstanceProvider.cs" /> … … 142 143 <EmbeddedResource Include="Data\Homberger.zip" /> 143 144 <EmbeddedResource Include="Data\LiLim.zip" /> 144 <EmbeddedResource Include="Data\Cordeau.zip" />145 145 <EmbeddedResource Include="Data\Golden.zip" /> 146 146 <EmbeddedResource Include="Data\Christofides.zip" /> … … 148 148 <EmbeddedResource Include="Data\Taillard.opt.zip" /> 149 149 <EmbeddedResource Include="Data\Taillard.zip" /> 150 <EmbeddedResource Include="Data\CordeauMD.zip" /> 151 <EmbeddedResource Include="Data\CordeauMDTW.zip" /> 150 152 <None Include="Plugin.cs.frame" /> 151 153 <Compile Include="Plugin.cs" /> … … 180 182 <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> 181 183 <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) 183 185 set ProjectDir=$(ProjectDir) 184 186 set SolutionDir=$(SolutionDir) … … 186 188 187 189 call PreBuildEvent.cmd</PreBuildEvent> 188 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' ">190 <PreBuildEvent Condition=" '$(OS)' != 'Windows_NT' "> 189 191 export ProjectDir=$(ProjectDir) 190 192 export SolutionDir=$(SolutionDir) -
stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/LiLimFormat/LiLimInstanceProvider.cs
r11170 r11334 37 37 get { return "LiLim test set"; } 38 38 } 39 39 40 40 public override Uri WebLink { 41 get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/P roblems/PDPTW/Li--Lim-benchmark/"); }41 get { return new Uri(@"http://www.sintef.no/Projectweb/TOP/PDPTW/Li--Lim-benchmark/"); } 42 42 } 43 43 -
stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/HombergerInstanceProvider.cs
r11170 r11334 37 37 get { return "Homberger test set"; } 38 38 } 39 39 40 40 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/"); } 42 42 } 43 43 -
stable/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs
r11333 r11334 93 93 routes.Add(route); 94 94 } 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 } 95 102 } 96 103 }
Note: See TracChangeset
for help on using the changeset viewer.