Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/10/14 12:34:07 (10 years ago)
Author:
pfleck
Message:

#2229 Added specific culture when parsing doubles in Cordeau solution parser.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauFormatInstanceProvider.cs

    r11432 r11442  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Globalization;
    2425using System.IO;
    2526using System.Linq;
     
    4243    protected override void LoadSolution(Stream stream, TData instance) {
    4344      using (var reader = new StreamReader(stream)) {
    44         double costs = double.Parse(reader.ReadLine());
     45        double costs = double.Parse(reader.ReadLine(), new CultureInfo("en-US"));
    4546
    4647        var toursPerDepotQuery =
     
    5051          let depot = int.Parse(tokens[0])
    5152          //let vehicle = int.Parse(tokens[1])
    52           //let duration = double.Parse(tokens[2])
    53           //let load = double.Parse(tokens[3])
     53          //let duration = double.Parse(tokens[2], new CultureInfo("en-US"))
     54          //let load = double.Parse(tokens[3], new CultureInfo("en-US"))
    5455          let customers = tokens.Skip(4).Where(t => !t.StartsWith("(")).Select(int.Parse)
    5556          let numberOfCustomers = customers.Count()
    56           //let serviceTimes = tokens.Skip(5).Where(t => t.StartsWith("(")).Select(t => int.Parse(t.Trim('(', ')')))
     57          //let serviceTimes = tokens.Skip(5).Where(t => t.StartsWith("(")).Select(t => double.Parse(t.Trim('(', ')'), new CultureInfo("en-US")))
    5758          let stops = customers.Skip(1).Take(numberOfCustomers - 2).Select(s => s - 1)
    5859          select new { depot, /*vehicle,*/ stops } into assignment
Note: See TracChangeset for help on using the changeset viewer.