Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/09/14 09:27:42 (10 years ago)
Author:
pfleck
Message:

#2229

  • Fixed 2 Bugs in Cordeau parser
    • some solution files contain empty lines
    • depots are not always identified with a zero, but sometimes with their depot number
  • Improved error message in VRP unit test
File:
1 edited

Legend:

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

    r11429 r11432  
    4646        var toursPerDepotQuery =
    4747          from line in ReadAllLines(reader)
     48          where !string.IsNullOrEmpty(line)
    4849          let tokens = line.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
    4950          let depot = int.Parse(tokens[0])
     
    5253          //let load = double.Parse(tokens[3])
    5354          let customers = tokens.Skip(4).Where(t => !t.StartsWith("(")).Select(int.Parse)
     55          let numberOfCustomers = customers.Count()
    5456          //let serviceTimes = tokens.Skip(5).Where(t => t.StartsWith("(")).Select(t => int.Parse(t.Trim('(', ')')))
    55           let stops = customers.Where(s => s != 0).Select(s => s - 1)
     57          let stops = customers.Skip(1).Take(numberOfCustomers - 2).Select(s => s - 1)
    5658          select new { depot, /*vehicle,*/ stops } into assignment
    5759          group assignment by assignment.depot;
Note: See TracChangeset for help on using the changeset viewer.