Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/20/16 14:02:36 (7 years ago)
Author:
gkronber
Message:

#1966: refactoring of bin packing implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingSolutionCrossover.cs

    r14046 r14128  
    3232  [Item("PackingSolutionCrossover", "A bin packing crossover operation.")]
    3333  [StorableClass]
    34   public abstract class PackingSolutionCrossover : SingleSuccessorOperator, IPackingSolutionCrossover, IStochasticOperator {
     34  public abstract class PackingSolutionCrossover<T> : SingleSuccessorOperator, IPackingSolutionCrossover<T>, IStochasticOperator
     35  where T : class, IItem {
    3536
    36     public ILookupParameter<IPackingSolutionEncoding> ChildParameter {
    37       get { return (ILookupParameter<IPackingSolutionEncoding>)Parameters["Child"]; }
     37    public ILookupParameter<T> ChildParameter {
     38      get { return (ILookupParameter<T>)Parameters["Child"]; }
    3839    }
    39     public IScopeTreeLookupParameter<IPackingSolutionEncoding> ParentsParameter {
    40       get { return (IScopeTreeLookupParameter<IPackingSolutionEncoding>)Parameters["Parents"]; }
     40    public IScopeTreeLookupParameter<T> ParentsParameter {
     41      get { return (IScopeTreeLookupParameter<T>)Parameters["Parents"]; }
    4142    }
    4243    public ILookupParameter<IRandom> RandomParameter {
     
    4647    [StorableConstructor]
    4748    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) { }
    4950    public PackingSolutionCrossover()
    5051      : base() {
    5152      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."));
    5354      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."));
    5556      ParentsParameter.ActualName = "EncodedSolution";
    5657    }
Note: See TracChangeset for help on using the changeset viewer.