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;

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

Legend:

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

    r9593 r9596  
    4141  [Item("Identical bin, two dimensional, extreme points based decoder for the GroupingVector encoding.", "<Description missing...>")]
    4242  [StorableClass]
    43   public class ExtremePointGroupingVectorDecoder2D : PackingSolutionDecoder<
    44       TwoDimensionalPacking,
    45       RectangularPackingBin,
    46       RectangularPackingItem>, I2DGVDecoder {
    47 
    48     public ExtremePointGroupingVectorDecoder2D ()
    49       : base() {
    50     }
     43  public class ExtremePointGroupingVectorDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DGVDecoder {
     44    public ExtremePointGroupingVectorDecoder2D () : base() {}
    5145    [StorableConstructor]
    5246    protected ExtremePointGroupingVectorDecoder2D (bool deserializing) : base(deserializing) { }
     
    5953
    6054    public static PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> Decode(GroupingVectorEncoding solution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    61       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    62         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    63 
    64       result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
    65 
     55      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
     56      result.Pack(solution, itemMeasures);
    6657      return result;
    6758    }
    6859
    6960    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    70                      
    7161      var solution = encodedSolution as GroupingVectorEncoding;
    7262      if (solution == null) throw new InvalidOperationException("Encoding is not of type GroupingVector");
    73 
    7463      return Decode(solution, binMeasures, itemMeasures);
    7564    }
  • 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    }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointPackingSequenceDecoder2D.cs

    r9593 r9596  
    4040  [Item("Identical bin, two dimensional, extreme points based decoder for the PackingSequence encoding.", "<Description missing...>")]
    4141  [StorableClass]
    42   public class ExtremePointPackingSequenceDecoder2D : PackingSolutionDecoder<
    43       TwoDimensionalPacking,
    44       RectangularPackingBin,
    45       RectangularPackingItem>, I2DPSDecoder {
    46 
    47     public ExtremePointPackingSequenceDecoder2D ()
    48       : base() {
    49     }
     42  public class ExtremePointPackingSequenceDecoder2D : PackingSolutionDecoder<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>, I2DPSDecoder {
     43    public ExtremePointPackingSequenceDecoder2D () : base() {}
    5044    [StorableConstructor]
    5145    protected ExtremePointPackingSequenceDecoder2D (bool deserializing) : base(deserializing) { }
     
    5953
    6054    public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) {
    61 
    6255      var solution = encodedSolution as PackingSequenceEncoding;
    6356      if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence");
    64 
    65       PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> result =
    66         new PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem>(binMeasures);
    67 
    68       result.BinPackings = TwoDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);//ExtremPointsFunctions2D.ExtremePointBasedPacking(solution, itemMeasures, binMeasures);
    69 
     57      PackingPlan2D result = new PackingPlan2D(binMeasures, true, false);
     58      result.Pack(solution, itemMeasures);
    7059      return result;
    7160    }
Note: See TracChangeset for help on using the changeset viewer.