Ignore:
Timestamp:
07/20/16 14:02:36 (5 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/PackingSequence/Moves/Swap2/Swap2MoveGenerator.cs

    r14046 r14128  
    2323using HeuristicLab.Common;
    2424using HeuristicLab.Core;
     25using HeuristicLab.Encodings.PermutationEncoding;
    2526using HeuristicLab.Operators;
    2627using HeuristicLab.Optimization;
     
    3637      get { return false; }
    3738    }
    38     public ILookupParameter<PackingSequenceEncoding> PackingSequenceParameter {
    39       get { return (ILookupParameter<PackingSequenceEncoding>)Parameters["PackingSequence"]; }
     39    public ILookupParameter<Permutation> PackingSequenceParameter {
     40      get { return (ILookupParameter<Permutation>)Parameters["PackingSequence"]; }
    4041    }
    41     public ILookupParameter<IPackingMove> PackingMoveParameter {
    42       get { return (LookupParameter<IPackingMove>)Parameters["PackingMove"]; }
     42    public ILookupParameter<IPackingMove<Permutation>> PackingMoveParameter {
     43      get { return (LookupParameter<IPackingMove<Permutation>>)Parameters["PackingMove"]; }
    4344    }
    4445    protected ScopeParameter CurrentScopeParameter {
     
    5152    public Swap2MoveGenerator()
    5253      : base() {
    53       Parameters.Add(new LookupParameter<PackingSequenceEncoding>("PackingSequence", "The Sequence vector for which moves should be generated."));
    54       Parameters.Add(new LookupParameter<IPackingMove>("PackingMove", "The moves that should be generated in subscopes."));
     54      Parameters.Add(new LookupParameter<Permutation>("PackingSequence", "The Sequence vector for which moves should be generated."));
     55      Parameters.Add(new LookupParameter<IPackingMove<Permutation>>("PackingMove", "The moves that should be generated in subscopes."));
    5556      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));
    5657    }
    5758
    5859    public override IOperation Apply() {
    59       PackingSequenceEncoding ps = PackingSequenceParameter.ActualValue;
     60      Permutation ps = PackingSequenceParameter.ActualValue;
    6061      Swap2Move[] moves = GenerateMoves(ps);
    6162      Scope[] moveScopes = new Scope[moves.Length];
     
    6869    }
    6970
    70     protected abstract Swap2Move[] GenerateMoves(PackingSequenceEncoding PackingSequence);
     71    protected abstract Swap2Move[] GenerateMoves(Permutation packingSequence);
    7172  }
    7273}
Note: See TracChangeset for help on using the changeset viewer.