Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
- Timestamp:
- 07/24/20 00:58:42 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Crossovers/PotvinRouteBasedCrossover.cs
r17226 r17698 44 44 } 45 45 46 public static PotvinEncod ing Apply(IRandom random, PotvinEncoding parent1, PotvinEncodingparent2, IVRPProblemInstance problemInstance, bool allowInfeasible) {47 PotvinEncod ing child = parent2.Clone() as PotvinEncoding;46 public static PotvinEncodedSolution Apply(IRandom random, PotvinEncodedSolution parent1, PotvinEncodedSolution parent2, IVRPProblemInstance problemInstance, bool allowInfeasible) { 47 PotvinEncodedSolution child = parent2.Clone() as PotvinEncodedSolution; 48 48 49 49 if (parent1.Tours.Count > 0 && child.Tours.Count > 0) { … … 78 78 else { 79 79 if (random.NextDouble() < 0.5) 80 return parent1.Clone() as PotvinEncod ing;80 return parent1.Clone() as PotvinEncodedSolution; 81 81 else 82 return parent2.Clone() as PotvinEncod ing;82 return parent2.Clone() as PotvinEncodedSolution; 83 83 } 84 84 } else { … … 87 87 } 88 88 89 protected override PotvinEncod ing Crossover(IRandom random, PotvinEncoding parent1, PotvinEncodingparent2) {89 protected override PotvinEncodedSolution Crossover(IRandom random, PotvinEncodedSolution parent1, PotvinEncodedSolution parent2) { 90 90 return Apply(random, parent1, parent2, ProblemInstance, AllowInfeasibleSolutions.Value.Value); 91 91 }
Note: See TracChangeset
for help on using the changeset viewer.