Changeset 8653
- Timestamp:
- 09/14/12 10:09:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
r8053 r8653 69 69 foreach (Tour tour in toBeRemoved) { 70 70 int index = Tours.IndexOf(tour); 71 Tours.Remove(tour); 71 72 if (index < VehicleAssignment.Length) { 72 73 int vehicle = VehicleAssignment[index]; 73 74 Tours.Remove(tour); 75 for (int i = index; i < VehicleAssignment.Length - 1; i++) {74 int max = System.Math.Min(VehicleAssignment.Length - 1, Tours.Count); 75 76 for (int i = index; i < max; i++) { 76 77 VehicleAssignment[i] = VehicleAssignment[i + 1]; 77 78 } 78 VehicleAssignment[ VehicleAssignment.Length - 1] = vehicle;79 VehicleAssignment[max] = vehicle; 79 80 } 80 81 }
Note: See TracChangeset
for help on using the changeset viewer.