Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/02/13 04:26:26 (12 years ago)
Author:
jhelm
Message:

#1966: Implemented additional Operator-Wrappers for PackingSequence and GroupingVector; Implemented additional problem-class for Rosenbauer-Problemstatement; Added marker-interfaces for decoder-types;

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem
Files:
2 edited

Legend:

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

    r9348 r9563  
    3838
    3939    public CuboidPackingBin TargetBin { get; set; }
     40    public double Weight { get; set; }
     41    public int Material { get; set; }
     42    public bool SupportsStacking(IPackingItem other) {
     43      return ((other.Material < this.Material) || (other.Material.Equals(this.Material) && other.Weight <= this.Weight));
     44    }
    4045
    4146    [StorableConstructor]
     
    4348    protected CuboidPackingItem(CuboidPackingItem original, Cloner cloner)
    4449      : base(original, cloner) {
     50        this.Weight = original.Weight;
     51        this.Material = original.Material;
    4552    }
    4653    public override IDeepCloneable Clone(Cloner cloner) {
     
    5158    }
    5259
     60    public CuboidPackingItem(int width, int height, int depth, CuboidPackingBin targetBin, double weight, int material) : this(width, height, depth, targetBin) { this.Weight = weight; this.Material = material; }
    5361    public CuboidPackingItem(int width, int height, int depth, CuboidPackingBin targetBin) : base(width, height, depth) { this.TargetBin = new CuboidPackingBin(targetBin.Width, targetBin.Height, targetBin.Depth); }
    5462
     
    5664      TargetBin = new CuboidPackingBin(targetBinMeasures[0], targetBinMeasures[1], targetBinMeasures[2]);
    5765    }
     66
     67    public override string ToString() {
     68      return String.Format("CuboidPackingItem ({0}, {1}, {2}; w={3}, m={4})", this.Width, this.Height, this.Depth, this.Weight,this.Material);
     69    }
    5870  }
    5971}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingItem/RectangularPackingItem.cs

    r9348 r9563  
    3737  public class RectangularPackingItem : RectangularPackingShape, IPackingItem{
    3838
    39     public RectangularPackingBin TargetBin { get; set; }
     39    public RectangularPackingBin TargetBin { get; set; }
     40    public double Weight { get; set; }
     41    public int Material { get; set; }
     42    public bool SupportsStacking(IPackingItem other) {
     43      return ((other.Material < this.Material) || (other.Material.Equals(this.Material) && other.Weight <= this.Weight));
     44    }
    4045
    4146    [StorableConstructor]
     
    4348    protected RectangularPackingItem(RectangularPackingItem original, Cloner cloner)
    4449      : base(original, cloner) {
     50      this.Weight = original.Weight;
     51      this.Material = original.Material;
    4552    }
    4653    public override IDeepCloneable Clone(Cloner cloner) {
     
    4855    }
    4956    public RectangularPackingItem() : base() {
    50 
    5157    }
    5258
Note: See TracChangeset for help on using the changeset viewer.