Changeset 14049 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/PackingItem.cs
- Timestamp:
- 07/12/16 20:03:45 (8 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/PackingItem.cs
r14048 r14049 29 29 30 30 namespace HeuristicLab.Problems.BinPacking2D { 31 [Item(" RectangularPackingItem", "Represents a rectangular packing-item for bin-packing problems.")]31 [Item("PackingItem (2d)", "Represents a rectangular packing-item for bin-packing problems.")] 32 32 [StorableClass] 33 public class RectangularPackingItem : RectangularPackingShape, IPackingItem {33 public class PackingItem : PackingShape, IPackingItem { 34 34 35 public RectangularPackingShape TargetBin {36 get { return ((IValueParameter< RectangularPackingShape>)Parameters["TargetBin"]).Value; }37 set { ((IValueParameter< RectangularPackingShape>)Parameters["TargetBin"]).Value = value; }35 public PackingShape TargetBin { 36 get { return ((IValueParameter<PackingShape>)Parameters["TargetBin"]).Value; } 37 set { ((IValueParameter<PackingShape>)Parameters["TargetBin"]).Value = value; } 38 38 } 39 39 … … 49 49 50 50 [StorableConstructor] 51 protected RectangularPackingItem(bool deserializing) : base(deserializing) { }52 protected RectangularPackingItem(RectangularPackingItem original, Cloner cloner)51 protected PackingItem(bool deserializing) : base(deserializing) { } 52 protected PackingItem(PackingItem original, Cloner cloner) 53 53 : base(original, cloner) { 54 54 } 55 55 56 56 public override IDeepCloneable Clone(Cloner cloner) { 57 return new RectangularPackingItem(this, cloner);57 return new PackingItem(this, cloner); 58 58 } 59 59 60 public RectangularPackingItem()60 public PackingItem() 61 61 : base() { 62 Parameters.Add(new ValueParameter< RectangularPackingShape>("TargetBin"));62 Parameters.Add(new ValueParameter<PackingShape>("TargetBin")); 63 63 Parameters.Add(new FixedValueParameter<DoubleValue>("Weight")); 64 64 Parameters.Add(new FixedValueParameter<IntValue>("Material")); 65 65 } 66 66 67 public RectangularPackingItem(int width, int height, RectangularPackingShape targetBin)67 public PackingItem(int width, int height, PackingShape targetBin) 68 68 : this() { 69 69 this.Width = width; 70 70 this.Height = height; 71 this.TargetBin = ( RectangularPackingShape)targetBin.Clone();71 this.TargetBin = (PackingShape)targetBin.Clone(); 72 72 } 73 73
Note: See TracChangeset
for help on using the changeset viewer.