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
Files:
3 deleted
6 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    }
  • 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.