Changeset 11432


Ignore:
Timestamp:
10/09/14 09:27:42 (8 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
Location:
trunk/sources
Files:
2 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;
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Problems.VehicleRouting-3.4/VRPInstancesTest.cs

    r11287 r11432  
    5555            ((dynamic)vrp).Load(((dynamic)provider).LoadData(instance));
    5656          } catch (Exception exc) {
    57             failedInstances.AppendLine(instance + ": " + exc.Message);
     57            failedInstances.AppendLine(instance.Name + ": " + exc.Message);
    5858          }
    5959        }
Note: See TracChangeset for help on using the changeset viewer.