Changeset 7887 for branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/GoldenFormat/GoldenParser.cs
- Timestamp:
- 05/24/12 10:41:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/GoldenFormat/GoldenParser.cs
r7883 r7887 48 48 private const int NODESECTION = 7; 49 49 private const int CAPACITY = 8; 50 private const int DISTANCE = 12; 50 51 private const int VEHICLES = 13; 51 52 private const int DEPOTSECTION = 9; … … 85 86 get { 86 87 return vehicles; 88 } 89 } 90 91 private double distance; 92 public double Distance { 93 get { 94 return distance; 87 95 } 88 96 } … … 113 121 capacity = -1; 114 122 vehicles = -1; 123 distance = -1; 115 124 demands = null; 116 125 } … … 179 188 case VEHICLES: 180 189 ReadVehicles(str); 190 break; 191 case DISTANCE: 192 ReadDistance(str); 181 193 break; 182 194 case DEPOTSECTION: … … 226 238 if (token.Equals("vehicles", StringComparison.OrdinalIgnoreCase)) 227 239 return VEHICLES; 240 if (token.Equals("distance", StringComparison.OrdinalIgnoreCase)) 241 return DISTANCE; 228 242 if (token.Equals("depot_section", StringComparison.OrdinalIgnoreCase)) 229 243 return DEPOTSECTION; … … 321 335 } 322 336 337 private void ReadDistance(string str) { 338 string[] tokens = str.Split(new string[] { ":" }, StringSplitOptions.None); 339 distance = double.Parse(tokens[tokens.Length - 1].Trim(), System.Globalization.CultureInfo.InvariantCulture); 340 } 341 323 342 private void ReadDepot(StreamReader reader) { 324 343 string[] tokens;
Note: See TracChangeset
for help on using the changeset viewer.