Ignore:
Timestamp:
01/12/16 10:42:58 (5 years ago)
Author:
gkronber
Message:

#1966: fixed various problems: bugs in cloning, bugs in persistence, method names, various minor improvements of source code for readability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/RectangularPackingItem.cs

    r13461 r13497  
    3333  public class RectangularPackingItem : RectangularPackingShape, IPackingItem {
    3434
     35    [Storable]
    3536    public RectangularPackingBin TargetBin { get; set; }
     37
     38    [Storable]
    3639    public double Weight { get; set; }
     40
     41    [Storable]
    3742    public int Material { get; set; }
     43
    3844    public bool SupportsStacking(IPackingItem other) {
    3945      return ((other.Material < this.Material) || (other.Material.Equals(this.Material) && other.Weight <= this.Weight));
     
    4652      this.Weight = original.Weight;
    4753      this.Material = original.Material;
     54      this.TargetBin = cloner.Clone(TargetBin);
    4855    }
    4956    public override IDeepCloneable Clone(Cloner cloner) {
     
    5461    }
    5562
    56     public RectangularPackingItem(int width, int height, RectangularPackingBin targetBin) : base(width, height) { this.TargetBin = new RectangularPackingBin(targetBin.Width, targetBin.Height); }
     63    public RectangularPackingItem(int width, int height, RectangularPackingBin targetBin)
     64      : base(width, height) {
     65      this.TargetBin = (RectangularPackingBin)targetBin.Clone();
     66    }
    5767
    5868    public void AddTargetBinMeasures(int[] targetBinMeasures) {
Note: See TracChangeset for help on using the changeset viewer.