Changeset 7891
- Timestamp:
- 05/24/12 11:12:39 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4/CordeauFormat/CordeauParser.cs
r7882 r7891 160 160 bool timeWindows = type == 6; 161 161 vehicles = int.Parse(m[1].Value); 162 cities = int.Parse(m[2].Value); 162 163 depots = int.Parse(m[3].Value); 163 164 line = reader.ReadLine(); … … 176 177 m = reg.Matches(line); 177 178 178 if ( m.Count >= 11) {179 if (demand.Count < cities) { 179 180 xCoord.Add(double.Parse(m[1].Value, System.Globalization.CultureInfo.InvariantCulture)); 180 181 yCoord.Add(double.Parse(m[2].Value, System.Globalization.CultureInfo.InvariantCulture)); … … 189 190 dueTime.Add(double.MaxValue); 190 191 } 191 } else if (m.Count >= 7){192 } else { 192 193 depotXcoord.Add(double.Parse(m[1].Value, System.Globalization.CultureInfo.InvariantCulture)); 193 194 depotYcoord.Add(double.Parse(m[2].Value, System.Globalization.CultureInfo.InvariantCulture)); … … 218 219 dueTime.InsertRange(0, depotDueTime); 219 220 220 cities = demand.Count;221 depots = depotXcoord.Count;222 223 221 List<double> originalCapacities = new List<double>(capacity); 224 222 capacity.Clear(); 225 for (int i = 0; i < vehicles; i++) {226 for (int j = 0; j < depots; j++) {223 for (int i = 0; i < depots; i++) { 224 for (int j = 0; j < vehicles; j++) { 227 225 capacity.Add(originalCapacities[i]); 228 226 }
Note: See TracChangeset
for help on using the changeset viewer.