Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/16 15:42:19 (8 years ago)
Author:
gkronber
Message:

#2650: merged r14457:14494 from trunk to branch (resolving conflicts)

Location:
branches/symbreg-factors-2650
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/symbreg-factors-2650

  • branches/symbreg-factors-2650/HeuristicLab.Problems.Instances.VehicleRouting/3.4/HeuristicLab.Problems.Instances.VehicleRouting-3.4.csproj

    r11650 r14498  
    158158    <EmbeddedResource Include="Data\CordeauMDTW.opt.zip" />
    159159    <EmbeddedResource Include="Data\Homberger.opt.zip" />
     160    <EmbeddedResource Include="Data\Solomon.opt.zip" />
    160161    <None Include="Plugin.cs.frame" />
    161162    <Compile Include="Plugin.cs" />
  • branches/symbreg-factors-2650/HeuristicLab.Problems.Instances.VehicleRouting/3.4/SolomonFormat/SolomonFormatInstanceProvider.cs

    r14185 r14498  
    2121
    2222using System;
    23 using System.Collections.Generic;
    2423using System.IO;
    2524using System.Linq;
     
    6463        string date = ExtractValue(reader.ReadLine());
    6564        string reference = ExtractValue(reader.ReadLine());
    66         reader.ReadLine(); // Solution
    67 
    68         var routesQuery =
    69           from line in reader.ReadAllLines()
    70           where !string.IsNullOrEmpty(line)
    71           let tokens = ExtractValue(line).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
    72           let stops = tokens.Select(int.Parse).Select(s => s - 1)
    73           select stops;
    74 
    75         var routes = routesQuery.Select(s => s.ToArray()).ToArray();
    76 
    77         instance.BestKnownTour = routes;
     65        switch (reader.ReadLine().Trim()) { // "Solution" or "Distance"
     66          case "Solution":
     67            var routesQuery = from line in reader.ReadAllLines()
     68                              where !string.IsNullOrEmpty(line)
     69                              let tokens = ExtractValue(line).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
     70                              let stops = tokens.Select(int.Parse).Select(s => s - 1)
     71                              select stops;
     72            var routes = routesQuery.Select(s => s.ToArray()).ToArray();
     73            instance.BestKnownTour = routes;
     74            break;
     75          case "Distance":
     76            double quality = double.Parse(reader.ReadLine());
     77            instance.BestKnownQuality = quality;
     78            break;
     79        }
    7880      }
    7981    }
Note: See TracChangeset for help on using the changeset viewer.