Changeset 9596 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Decoders/3D/EP/ExtremePointPackingSequenceDecoder3D.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/3D/EP/ExtremePointPackingSequenceDecoder3D.cs
r9593 r9596 41 41 [Item("Identical bin, three dimensional, extreme points based decoder for the PackingSequence encoding.", "<Description missing...>")] 42 42 [StorableClass] 43 public class ExtremePointPackingSequenceDecoder3D : PackingSolutionDecoder< 44 ThreeDimensionalPacking, 45 CuboidPackingBin, 46 CuboidPackingItem>, I3DPSDecoder { 47 48 public ValueParameter<BoolValue> StackingConstraintsParameter { 49 get { return (ValueParameter<BoolValue>)Parameters["StackingConstraint"]; } 50 } 51 52 public ExtremePointPackingSequenceDecoder3D () 53 : base() { 54 Parameters.Add(new ValueParameter<BoolValue>("StackingConstraint", "A flag determining whether stackingconstraints should be enforced or not.")); 55 } 43 public class ExtremePointPackingSequenceDecoder3D : PackingSolutionDecoder<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>, I3DPSDecoder { 44 public ExtremePointPackingSequenceDecoder3D () : base() {} 56 45 [StorableConstructor] 57 46 protected ExtremePointPackingSequenceDecoder3D (bool deserializing) : base(deserializing) { } … … 65 54 66 55 public override PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> CreatePackingPlanFromEncoding(IItem encodedSolution, CuboidPackingBin binMeasures, ItemList<CuboidPackingItem> itemMeasures) { 67 68 56 var solution = encodedSolution as PackingSequenceEncoding; 69 57 if (solution == null) throw new InvalidOperationException("Encoding is not of type PackingSequence"); 70 71 PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem> result = 72 new PackingPlan<ThreeDimensionalPacking, CuboidPackingBin, CuboidPackingItem>(binMeasures); 73 74 result.BinPackings = ThreeDimensionalPackingFunctions.ExtremePointBasedPacking(solution, itemMeasures, binMeasures, StackingConstraintsParameter.Value.Value); 75 58 PackingPlan3D result = new PackingPlan3D(binMeasures, true, StackingConstraintsParameter.Value.Value); 59 result.Pack(solution, itemMeasures); 76 60 return result; 77 61 }
Note: See TracChangeset
for help on using the changeset viewer.