Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/RandomParentCloneCrossover.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/General/Crossovers/RandomParentCloneCrossover.cs
r17226 r17698 36 36 } 37 37 38 public ILookupParameter<ItemArray<IVRPEncod ing>> ParentsParameter {39 get { return (ScopeTreeLookupParameter<IVRPEncod ing>)Parameters["Parents"]; }38 public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter { 39 get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; } 40 40 } 41 41 42 public ILookupParameter<IVRPEncod ing> ChildParameter {43 get { return (ILookupParameter<IVRPEncod ing>)Parameters["Child"]; }42 public ILookupParameter<IVRPEncodedSolution> ChildParameter { 43 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; } 44 44 } 45 45 … … 51 51 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 52 52 53 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncod ing>("Parents", "The parent permutations which should be crossed."));53 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed.")); 54 54 ParentsParameter.ActualName = "VRPTours"; 55 Parameters.Add(new LookupParameter<IVRPEncod ing>("Child", "The child permutation resulting from the crossover."));55 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover.")); 56 56 ChildParameter.ActualName = "VRPTours"; 57 57 } … … 67 67 public override IOperation InstrumentedApply() { 68 68 if (RandomParameter.ActualValue.Next() < 0.5) 69 ChildParameter.ActualValue = ParentsParameter.ActualValue[0].Clone() as IVRPEncod ing;69 ChildParameter.ActualValue = ParentsParameter.ActualValue[0].Clone() as IVRPEncodedSolution; 70 70 else 71 ChildParameter.ActualValue = ParentsParameter.ActualValue[1].Clone() as IVRPEncod ing;71 ChildParameter.ActualValue = ParentsParameter.ActualValue[1].Clone() as IVRPEncodedSolution; 72 72 73 73 return base.InstrumentedApply();
Note: See TracChangeset
for help on using the changeset viewer.