Changeset 13574 for branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs
- Timestamp:
- 01/28/16 18:32:54 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Shapes/CuboidPackingShape.cs
r13497 r13574 26 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 27 using HeuristicLab.Common; 28 using HeuristicLab.Data; 29 using HeuristicLab.Parameters; 28 30 using HeuristicLab.Problems.BinPacking.Dimensions; 29 31 … … 33 35 public abstract class CuboidPackingShape : PackingShape<ThreeDimensionalPacking>, IRegularPackingShape, IComparable<CuboidPackingShape> { 34 36 #region Properties 35 /// <summary>36 /// Describes the size on the X-axis37 /// </summary>38 [Storable]39 public int Width { get; set; } 40 /// <summary>41 /// Describes the size on the Y-axis42 /// </summary>43 [Storable]44 public int Height { get; set; } 45 /// <summary>46 /// Describes the size on the Z-axis47 /// </summary>48 [Storable]49 public int Depth { get; set; } 37 public int Height { 38 get { return ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value; } 39 set { ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value = value; } 40 } 41 42 public int Width { 43 get { return ((IFixedValueParameter<IntValue>)Parameters["Width"]).Value.Value; } 44 set { ((IFixedValueParameter<IntValue>)Parameters["Width"]).Value.Value = value; } 45 } 46 47 public int Depth { 48 get { return ((IFixedValueParameter<IntValue>)Parameters["Depth"]).Value.Value; } 49 set { ((IFixedValueParameter<IntValue>)Parameters["Depth"]).Value.Value = value; } 50 } 51 50 52 #endregion 51 53 … … 101 103 #endregion 102 104 103 protected CuboidPackingShape(int width, int height, int depth) 104 : base() { 105 this.Width = width; 106 this.Height = height; 107 this.Depth = depth; 108 } 105 109 106 110 107 public override void InitializeFromMeasures(int[] measures) { … … 119 116 } 120 117 118 119 protected CuboidPackingShape() 120 : base() { 121 Parameters.Add(new FixedValueParameter<IntValue>("Width")); 122 Parameters.Add(new FixedValueParameter<IntValue>("Height")); 123 Parameters.Add(new FixedValueParameter<IntValue>("Depth")); 124 } 125 126 protected CuboidPackingShape(int width, int height, int depth) 127 : this() { 128 this.Width = width; 129 this.Height = height; 130 this.Depth = depth; 131 } 132 121 133 [StorableConstructor] 122 134 protected CuboidPackingShape(bool deserializing) : base(deserializing) { } 123 135 protected CuboidPackingShape(CuboidPackingShape original, Cloner cloner) 124 136 : base(original, cloner) { 125 this.Width = original.Width;126 this.Height = original.Height;127 this.Depth = original.Depth;128 137 } 129 130 protected CuboidPackingShape() : base() { }131 138 132 139 public override string ToString() {
Note: See TracChangeset
for help on using the changeset viewer.