Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/13 01:20:12 (12 years ago)
Author:
jhelm
Message:

#1966: More refactoring; Added more sophisticated structures for packing-plan and bin-packing representation; Transferred parts of the decoding-algorithms to these structures; Did some more refactoring and cleanup;

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftGroupingVectorDecoder.cs

    r9593 r9596  
    4141  [Item("Identical bin two dimensional grouping vector decoder", "<Description missing...>")]
    4242  [StorableClass]
    43   public class BottomLeftGroupingVectorDecoder : PackingSolutionDecoder<
    44       TwoDimensionalPacking,
    45       RectangularPackingBin,
    46       RectangularPackingItem>, I2DGVDecoder {
    47 
    48     public BottomLeftGroupingVectorDecoder()
    49       : base() {
    50         //EncodedSolutionParameter.ActualName = "EncodedSolution";
    51     }
     43  public class BottomLeftGroupingVectorDecoder : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin,RectangularPackingItem>, I2DGVDecoder {
     44    public BottomLeftGroupingVectorDecoder() : base() {}
    5245    [StorableConstructor]
    5346    protected BottomLeftGroupingVectorDecoder(bool deserializing) : base(deserializing) { }
     
    5952    }
    6053
    61 
    6254    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    63 
    6455      var solution = encodedSolution as GroupingVectorEncoding;
    6556      if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
    66 
    67       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    68         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    69 
    70       result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
     57      PackingPlan2D result = new PackingPlan2D(binMeasures);
     58      result.Pack(solution, itemMeasures);
    7159      return result;
    7260    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftMultiComponentVectorDecoder.cs

    r9593 r9596  
    4141  [Item("Identical bin two dimensional multi component vector decoder", "<Description missing...>")]
    4242  [StorableClass]
    43   public class BottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<
    44       TwoDimensionalPacking,
    45       RectangularPackingBin,
    46       RectangularPackingItem>, I2DMCVDecoder {
    47 
    48     public BottomLeftMultiComponentVectorDecoder()
    49       : base() {
    50       //EncodedSolutionParameter.ActualName = "EncodedSolution";
    51     }
     43  public class BottomLeftMultiComponentVectorDecoder : PackingSolutionDecoder<TwoDimensionalPacking,RectangularPackingBin, RectangularPackingItem>, I2DMCVDecoder {
     44    public BottomLeftMultiComponentVectorDecoder() : base() {}
    5245    [StorableConstructor]
    5346    protected BottomLeftMultiComponentVectorDecoder(bool deserializing) : base(deserializing) { }
     
    5952    }
    6053
    61 
    6254    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    63 
    6455      var solution = encodedSolution as MultiComponentVectorEncoding;
    6556      if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponent Vector");
    66 
    67       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    68         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    69 
    70       result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
    71 
     57      PackingPlan2D result = new PackingPlan2D(binMeasures);
     58      result.Pack(solution, itemMeasures);
    7259      return result;
    7360    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/BL/BottomLeftPackingSequenceDecoder.cs

    r9593 r9596  
    4040  [Item("Identical bin, two dimensional, direct permutation decoder", "<Description missing...>")]
    4141  [StorableClass]
    42   public class BottomLeftPackingSequenceDecoder : PackingSolutionDecoder<
    43       TwoDimensionalPacking,
    44       RectangularPackingBin,
    45       RectangularPackingItem>, I2DPSDecoder {
     42  public class BottomLeftPackingSequenceDecoder : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DPSDecoder {
    4643
    47     public BottomLeftPackingSequenceDecoder()
    48       : base() {
    49         //EncodedSolutionParameter.ActualName = "EncodedSolution";
    50     }
     44    public BottomLeftPackingSequenceDecoder(): base() { }
    5145    [StorableConstructor]
    5246    protected BottomLeftPackingSequenceDecoder(bool deserializing) : base(deserializing) { }
     
    5852    }
    5953
    60 
    6154    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    62 
    6355      var solution = encodedSolution as PackingSequenceEncoding;
    6456      if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
    65 
    66       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    67         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    68 
    69       result.BinPackings = TwoDimensionalPackingFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures); //BottomLeftFunctions.BottomLeftPacking(solution, binMeasures, itemMeasures);
    70 
     57      PackingPlan2D result = new PackingPlan2D(binMeasures);
     58      result.Pack(solution, itemMeasures);
    7159      return result;
    7260    }
Note: See TracChangeset for help on using the changeset viewer.