Changeset 17698 for branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers
- Timestamp:
- 07/24/20 00:58:42 (4 years ago)
- Location:
- branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/MultiVRPSolutionCrossover.cs
r17226 r17698 48 48 } 49 49 50 public ILookupParameter<ItemArray<IVRPEncod ing>> ParentsParameter {51 get { return (ScopeTreeLookupParameter<IVRPEncod ing>)Parameters["Parents"]; }50 public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter { 51 get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; } 52 52 } 53 53 54 public ILookupParameter<IVRPEncod ing> ChildParameter {55 get { return (ILookupParameter<IVRPEncod ing>)Parameters["Child"]; }54 public ILookupParameter<IVRPEncodedSolution> ChildParameter { 55 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; } 56 56 } 57 57 … … 63 63 Parameters.Add(new LookupParameter<IVRPProblemInstance>("ProblemInstance", "The VRP problem instance")); 64 64 65 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncod ing>("Parents", "The parent permutations which should be crossed."));65 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed.")); 66 66 ParentsParameter.ActualName = "VRPTours"; 67 Parameters.Add(new LookupParameter<IVRPEncod ing>("Child", "The child permutation resulting from the crossover."));67 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover.")); 68 68 ChildParameter.ActualName = "VRPTours"; 69 69 -
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(); -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/VRPCrossover.cs
r17226 r17698 30 30 [StorableType("E26BAD0A-49E6-477C-AEA0-CB41552F0B2B")] 31 31 public abstract class VRPCrossover : VRPOperator, IVRPCrossover { 32 public ILookupParameter<ItemArray<IVRPEncod ing>> ParentsParameter {33 get { return (ScopeTreeLookupParameter<IVRPEncod ing>)Parameters["Parents"]; }32 public ILookupParameter<ItemArray<IVRPEncodedSolution>> ParentsParameter { 33 get { return (ScopeTreeLookupParameter<IVRPEncodedSolution>)Parameters["Parents"]; } 34 34 } 35 35 36 public ILookupParameter<IVRPEncod ing> ChildParameter {37 get { return (ILookupParameter<IVRPEncod ing>)Parameters["Child"]; }36 public ILookupParameter<IVRPEncodedSolution> ChildParameter { 37 get { return (ILookupParameter<IVRPEncodedSolution>)Parameters["Child"]; } 38 38 } 39 39 … … 43 43 public VRPCrossover() 44 44 : base() { 45 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncod ing>("Parents", "The parent permutations which should be crossed."));45 Parameters.Add(new ScopeTreeLookupParameter<IVRPEncodedSolution>("Parents", "The parent permutations which should be crossed.")); 46 46 ParentsParameter.ActualName = "VRPTours"; 47 Parameters.Add(new LookupParameter<IVRPEncod ing>("Child", "The child permutation resulting from the crossover."));47 Parameters.Add(new LookupParameter<IVRPEncodedSolution>("Child", "The child permutation resulting from the crossover.")); 48 48 ChildParameter.ActualName = "VRPTours"; 49 49 }
Note: See TracChangeset
for help on using the changeset viewer.