Changeset 14128 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSolutionCrossover.cs
- Timestamp:
- 07/20/16 14:02:36 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSolutionCrossover.cs
r14046 r14128 32 32 [Item("PackingSolutionCrossover", "A bin packing crossover operation.")] 33 33 [StorableClass] 34 public abstract class PackingSolutionCrossover : SingleSuccessorOperator, IPackingSolutionCrossover, IStochasticOperator { 34 public abstract class PackingSolutionCrossover<T> : SingleSuccessorOperator, IPackingSolutionCrossover<T>, IStochasticOperator 35 where T : class, IItem { 35 36 36 public ILookupParameter< IPackingSolutionEncoding> ChildParameter {37 get { return (ILookupParameter< IPackingSolutionEncoding>)Parameters["Child"]; }37 public ILookupParameter<T> ChildParameter { 38 get { return (ILookupParameter<T>)Parameters["Child"]; } 38 39 } 39 public IScopeTreeLookupParameter< IPackingSolutionEncoding> ParentsParameter {40 get { return (IScopeTreeLookupParameter< IPackingSolutionEncoding>)Parameters["Parents"]; }40 public IScopeTreeLookupParameter<T> ParentsParameter { 41 get { return (IScopeTreeLookupParameter<T>)Parameters["Parents"]; } 41 42 } 42 43 public ILookupParameter<IRandom> RandomParameter { … … 46 47 [StorableConstructor] 47 48 protected PackingSolutionCrossover(bool deserializing) : base(deserializing) { } 48 protected PackingSolutionCrossover(PackingSolutionCrossover original, Cloner cloner) : base(original, cloner) { }49 protected PackingSolutionCrossover(PackingSolutionCrossover<T> original, Cloner cloner) : base(original, cloner) { } 49 50 public PackingSolutionCrossover() 50 51 : base() { 51 52 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator which should be used for stochastic manipulation operators.")); 52 Parameters.Add(new LookupParameter< IPackingSolutionEncoding>("Child", "The child solution resulting from the crossover."));53 Parameters.Add(new LookupParameter<T>("Child", "The child solution resulting from the crossover.")); 53 54 ChildParameter.ActualName = "EncodedSolution"; 54 Parameters.Add(new ScopeTreeLookupParameter< IPackingSolutionEncoding>("Parents", "The parent solution which should be crossed."));55 Parameters.Add(new ScopeTreeLookupParameter<T>("Parents", "The parent solution which should be crossed.")); 55 56 ParentsParameter.ActualName = "EncodedSolution"; 56 57 }
Note: See TracChangeset
for help on using the changeset viewer.