Changeset 9596 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs
- Timestamp:
- 06/07/13 01:20:12 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/2D/EP/ExtremePointMultiComponentVectorDecoder2D.cs
r9593 r9596 42 42 [Item("Identical bin, two dimensional, extreme points based decoder for the MultiComponentVector encoding.", "<Description missing...>")] 43 43 [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() {} 52 46 [StorableConstructor] 53 47 protected ExtremePointMultiComponentVectorDecoder2D (bool deserializing) : base(deserializing) { } … … 60 54 61 55 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); 67 58 return result; 68 59 } 69 60 70 61 public override PackingPlan<TwoDimensionalPacking, RectangularPackingBin, RectangularPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, RectangularPackingBin binMeasures, ItemList<RectangularPackingItem> itemMeasures) { 71 72 62 var solution = encodedSolution as MultiComponentVectorEncoding; 73 63 if (solution == null) throw new InvalidOperationException("Encoding is not of type MultiComponentVector"); 74 75 64 return Decode(solution, binMeasures, itemMeasures); 76 65 }
Note: See TracChangeset
for help on using the changeset viewer.