Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/13 01:20:12 (11 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;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs

    r9593 r9596  
    4242  [Item("Identical bin, two dimensional, extreme points based decoder for the MultiComponentVector encoding.", "<Description missing...>")]
    4343  [StorableClass]
    44   public class ExtremePointMultiComponentVectorDecoder2D : PackingSolutionDecoder<
    45       TwoDimensionalPacking,
    46       RectangularPackingBin,
    47       RectangularPackingItem>, I2DMCVDecoder {
    48 
    49     public ExtremePointMultiComponentVectorDecoder2D ()
    50       : base() {
    51     }
     44  public class ExtremePointMultiComponentVectorDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking,RectangularPackingBin, RectangularPackingItem>, I2DMCVDecoder {
     45    public ExtremePointMultiComponentVectorDecoder2D () : base() {}
    5246    [StorableConstructor]
    5347    protected ExtremePointMultiComponentVectorDecoder2D (bool deserializing) : base(deserializing) { }
     
    6054
    6155    public static PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Decode(MultiComponentVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    62       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    63         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    64 
    65       result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
    66 
     56      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
     57      result.Pack(solution, itemMeasures);
    6758      return result;
    6859    }
    6960
    7061    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    71 
    7262      var solution = encodedSolution as MultiComponentVectorEncoding;
    7363      if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector");
    74 
    7564      return Decode(solution, binMeasures, itemMeasures);
    7665    }
Note: See TracChangeset for help on using the changeset viewer.