- Timestamp:
- 11/04/11 11:44:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs
r6851 r6947 205 205 206 206 int length = Math.Min(Length.Value.Value, parent1.Tours.Count) + 1; 207 int k = random.Next(1, length); 207 int k = 1; 208 if(length > 1) 209 k = random.Next(1, length); 208 210 for (int i = 0; i < k; i++) { 209 211 int index = SelectRandomTourBiasedByLength(random, p1Clone); … … 227 229 228 230 //DESTROY - remove cities from r1 229 int removed = random.Next(1, r1.Stops.Count + 1); 231 int removed = 1; 232 if(r1.Stops.Count > 1) 233 removed = random.Next(1, r1.Stops.Count + 1); 230 234 for (int i = 0; i < removed; i++) { 231 235 childTour.Stops.RemoveAt(SelectCityBiasedByNeighborDistance(random, childTour, child));
Note: See TracChangeset
for help on using the changeset viewer.