- Timestamp:
- 03/05/12 10:15:50 (12 years ago)
- Location:
- branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/AlbaEncoding.cs
r6851 r7543 126 126 int cities = instance.Cities.Value; 127 127 128 int vehicle = cities;129 128 for (int i = 0; i < route.Count; i++) { 130 if (route[i] == 0) {131 route[i] = vehicle;132 vehicle++;129 if (route[i] <= 0) { 130 int vehicle = -route[i]; 131 route[i] = cities + vehicle; 133 132 } else { 134 133 route[i] = route[i] - 1; -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Creators/RandomCreator.cs
r4752 r7543 65 65 perm[i] = i + 1; 66 66 for (int i = cities; i < cities + vehicles; i++) 67 perm[i] = 0;67 perm[i] = -(i - cities); 68 68 for (int i = 0; i < perm.Length - 2; i++) { 69 69 sortingArray[i] = RandomParameter.ActualValue.Next(perm.Length * 2); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs
r7203 r7543 128 128 Tour tour = new Tour(); 129 129 for (int i = 0; i < route.Count; i++) { 130 if (route[i] == 0) {130 if (route[i] <= 0) { 131 131 if (tour.Stops.Count > 0) { 132 132 solution.Tours.Add(tour); -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/PotvinEncoding.cs
r6960 r7543 130 130 PotvinEncoding solution = new PotvinEncoding(instance); 131 131 132 TourEncoding.ConvertFrom(route, solution); 132 solution.Tours = new ItemList<Tour>(); 133 134 Tour tour = new Tour(); 135 int routeIdx = 0; 136 for (int i = 0; i < route.Count; i++) { 137 if (route[i] <= 0) { 138 if (tour.Stops.Count > 0) { 139 solution.Tours.Add(tour); 140 tour = new Tour(); 141 } 142 int vehicle = -route[i]; 143 solution.VehicleAssignment[routeIdx] = vehicle; 144 routeIdx++; 145 } else { 146 tour.Stops.Add(route[i]); 147 } 148 } 149 150 solution.Repair(); 133 151 134 152 return solution;
Note: See TracChangeset
for help on using the changeset viewer.