- Timestamp:
- 08/25/10 16:29:06 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.3/ORLIBParser.cs
r4315 r4317 25 25 using System.Text; 26 26 using System.IO; 27 using System.Globalization; 27 28 28 29 namespace HeuristicLab.Problems.VehicleRouting { 29 30 class ORLIBParser { 30 31 private StreamReader source; 32 CultureInfo culture = new CultureInfo("en-US"); 31 33 32 34 private string name; … … 101 103 line = source.ReadLine(); 102 104 tokens = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); 103 vertices[0, 0] = double.Parse(tokens[0] );104 vertices[0, 1] = double.Parse(tokens[1] );105 vertices[0, 0] = double.Parse(tokens[0], culture.NumberFormat); 106 vertices[0, 1] = double.Parse(tokens[1], culture.NumberFormat); 105 107 106 108 for (int i = 0; i < customers; i++) { 107 109 line = source.ReadLine(); 108 110 tokens = line.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries); 109 vertices[i + 1, 0] = double.Parse(tokens[0] );110 vertices[i + 1, 1] = double.Parse(tokens[1] );111 demands[i + 1] = double.Parse(tokens[2] );111 vertices[i + 1, 0] = double.Parse(tokens[0], culture.NumberFormat); 112 vertices[i + 1, 1] = double.Parse(tokens[1], culture.NumberFormat); 113 demands[i + 1] = double.Parse(tokens[2], culture.NumberFormat); 112 114 } 113 115 }
Note: See TracChangeset
for help on using the changeset viewer.