Changeset 6838 for branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers
- Timestamp:
- 09/27/11 13:29:56 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinInsertionBasedCrossover.cs
r6752 r6838 149 149 150 150 private bool FindRouteInsertionPlace( 151 PotvinEncoding individual, 151 152 Tour tour, 152 153 int city, bool allowInfeasible, out int place) { … … 162 163 163 164 double minDetour = 0; 164 VRPEvaluation eval = ProblemInstance.Evaluate (tour);165 VRPEvaluation eval = ProblemInstance.EvaluateTour(tour, individual); 165 166 bool originalFeasible = ProblemInstance.Feasible(eval); 166 167 … … 220 221 221 222 Tour childTour = new Tour(); 223 child.Tours.Add(childTour); 222 224 childTour.Stops.AddRange(r1.Stops); 223 225 … … 233 235 234 236 while (count < maxCount && R2.Count != 0) { 235 PotvinEncoding newChild = child.Clone() as PotvinEncoding;236 newChild.Tours.Add(childTour);237 238 237 int index = random.Next(R2.Count); 239 238 int city = R2[index]; … … 241 240 242 241 int place = -1; 243 bool found = FindRouteInsertionPlace(child Tour, city, allowInfeasible, out place);242 bool found = FindRouteInsertionPlace(child, childTour, city, allowInfeasible, out place); 244 243 if (found) { 245 244 childTour.Stops.Insert(place, city); … … 253 252 } 254 253 255 child.Tours.Add(childTour);256 254 Repair(random, child, childTour, ProblemInstance, allowInfeasible); 257 255 }
Note: See TracChangeset
for help on using the changeset viewer.