Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsCrossover.cs
- Timestamp:
- 07/24/20 00:58:42 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsCrossover.cs
r17226 r17698 49 49 } 50 50 51 protected abstract PrinsEncod ing Crossover(IRandom random, PrinsEncoding parent1, PrinsEncodingparent2);51 protected abstract PrinsEncodedSolution Crossover(IRandom random, PrinsEncodedSolution parent1, PrinsEncodedSolution parent2); 52 52 53 53 public override IOperation InstrumentedApply() { 54 ItemArray<IVRPEncod ing> parents = new ItemArray<IVRPEncoding>(ParentsParameter.ActualValue.Length);54 ItemArray<IVRPEncodedSolution> parents = new ItemArray<IVRPEncodedSolution>(ParentsParameter.ActualValue.Length); 55 55 for (int i = 0; i < ParentsParameter.ActualValue.Length; i++) { 56 IVRPEncod ingsolution = ParentsParameter.ActualValue[i];56 IVRPEncodedSolution solution = ParentsParameter.ActualValue[i]; 57 57 58 if (!(solution is PrinsEncod ing)) {59 parents[i] = PrinsEncod ing.ConvertFrom(solution, ProblemInstance);58 if (!(solution is PrinsEncodedSolution)) { 59 parents[i] = PrinsEncodedSolution.ConvertFrom(solution, ProblemInstance); 60 60 } else { 61 61 parents[i] = solution; … … 65 65 66 66 ChildParameter.ActualValue = 67 Crossover(RandomParameter.ActualValue, parents[0] as PrinsEncod ing, parents[1] as PrinsEncoding);67 Crossover(RandomParameter.ActualValue, parents[0] as PrinsEncodedSolution, parents[1] as PrinsEncodedSolution); 68 68 69 69 return base.InstrumentedApply();
Note: See TracChangeset
for help on using the changeset viewer.