Changeset 14043


Ignore:
Timestamp:
07/12/16 18:02:28 (12 months ago)
Author:
gkronber
Message:

#1966: removed interface IRegularPacking shape (=> all our packing shapes are regular)

Location:
branches/HeuristicLab.BinPacking
Files:
11 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/RectangularPackingShape.cs

    r13606 r14043  
    3333  [Item("RectangularPackingShape", "Represents the rectangular measures (width, height) of a two-dimensional bin-packing object.")]
    3434  [StorableClass]
    35   public abstract class RectangularPackingShape : PackingShape<TwoDimensionalPacking>, IRegularPackingShape, IComparable<RectangularPackingShape> {
     35  public abstract class RectangularPackingShape : PackingShape<TwoDimensionalPacking>, IComparable<RectangularPackingShape> {
    3636    public int Height {
    3737      get { return ((IFixedValueParameter<IntValue>)Parameters["Height"]).Value.Value; }
     
    7373    }
    7474
    75     public int CompareTo(object obj) {
     75    public override int CompareTo(object obj) {
    7676      var other = obj as RectangularPackingShape;
    7777      if (other != null) return CompareTo(other);
     
    118118    }
    119119
    120     public void ApplyHorizontalOrientation() {
     120    public override void ApplyHorizontalOrientation() {
    121121      if (Width < Height) {
    122122        var aux = Width;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.3D/3.3/CuboidPackingShape.cs

    r13608 r14043  
    3232  [Item("CuboidPackingShape", "Represents the cuboid measures (width, height, depth) of a three-dimensional cuboidic bin-packing object.")]
    3333  [StorableClass]
    34   public abstract class CuboidPackingShape : PackingShape<ThreeDimensionalPacking>, IRegularPackingShape, IComparable<CuboidPackingShape> {
     34  public abstract class CuboidPackingShape : PackingShape<ThreeDimensionalPacking>, IComparable<CuboidPackingShape> {
    3535    public IFixedValueParameter<IntValue> HeightParameter {
    3636      get { return (IFixedValueParameter<IntValue>)Parameters["Height"]; }
     
    110110    }
    111111
    112     public int CompareTo(object obj) {
     112    public override int CompareTo(object obj) {
    113113      var other = (CuboidPackingShape)obj;
    114114      if (other != null) return CompareTo(other);
     
    179179    }
    180180
    181     public void ApplyHorizontalOrientation() {
     181    public override void ApplyHorizontalOrientation() {
    182182      if (Width > Depth) {
    183183        var aux = Width;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Analyzers/BestBinPackingSolutionAnalyzer.cs

    r13605 r14043  
    3838  public class BestBinPackingSolutionAnalyzer<D, B, I> : BinPackingAnalyzer<D, B, I>, IStochasticOperator
    3939    where D : class, IPackingDimensions
    40     where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    41     where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
     40    where B : PackingShape<D>, IPackingBin
     41    where I : PackingShape<D>, IPackingItem {
    4242
    4343    public ILookupParameter<IRandom> RandomParameter {
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/BinPackingProblem.cs

    r14040 r14043  
    4343  public abstract class BinPackingProblem<D, B, I> : SingleObjectiveHeuristicOptimizationProblem<IPackingPlanEvaluationAlgorithm, IPackingSolutionCreator>
    4444    where D : class, IPackingDimensions
    45     where B : PackingShape<D>, IPackingBin, IRegularPackingShape, new()
    46     where I : PackingShape<D>, IPackingItem, IRegularPackingShape, new () {
     45    where B : PackingShape<D>, IPackingBin, new()
     46    where I : PackingShape<D>, IPackingItem, new () {
    4747
    4848
     
    150150    protected void ApplyHorizontalOrientation() {
    151151      PackingBinMeasures.ApplyHorizontalOrientation();
    152       foreach (IRegularPackingShape shape in PackingItemMeasures) {
     152      foreach (IPackingShape shape in PackingItemMeasures) {
    153153        shape.ApplyHorizontalOrientation();
    154154      }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/BinUtilizationRegularIdenticalBinEvaluator.cs

    r13608 r14043  
    3434  public abstract class BinUtilizationRegularIdenticalBinEvaluator<D, B, I> : RegularSimpleRotationIdenticalBinPackingPlanEvaluator<D, B, I>
    3535    where D : class, IPackingDimensions
    36     where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    37     where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
     36    where B : PackingShape<D>, IPackingBin
     37    where I : PackingShape<D>, IPackingItem {
    3838
    3939    [StorableConstructor]
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/PackingRatioRegularIdenticalBinEvaluator.cs

    r13608 r14043  
    3434  public abstract class PackingRatioRegularIdenticalBinEvaluator<D, B, I> : RegularSimpleRotationIdenticalBinPackingPlanEvaluator<D, B, I>
    3535    where D : class, IPackingDimensions
    36     where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    37     where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
     36    where B : PackingShape<D>, IPackingBin
     37    where I : PackingShape<D>, IPackingItem {
    3838
    3939    [StorableConstructor]
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/RegularSimpleRotationIdenticalBinPackingPlanEvaluator.cs

    r13608 r14043  
    3333  public abstract class RegularSimpleRotationIdenticalBinPackingPlanEvaluator<D, B, I> : PackingPlanEvaluator<D, B, I>
    3434    where D : class, IPackingDimensions
    35     where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    36     where I : PackingShape<D>, IPackingItem, IRegularPackingShape {
     35    where B : PackingShape<D>, IPackingBin
     36    where I : PackingShape<D>, IPackingItem {
    3737
    3838    #region Parameter Properties
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/HeuristicLab.Problems.BinPacking-3.3.csproj

    r14040 r14043  
    282282    <Compile Include="PackingDimensions.cs" />
    283283    <Compile Include="PackingMoveEvaluator.cs" />
    284     <Compile Include="Interfaces\IRegularPackingShape.cs" />
    285284    <Compile Include="Interfaces\IPackingBin.cs" />
    286285    <Compile Include="Interfaces\IPackingItem.cs" />
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Interfaces/IPackingShape.cs

    r13605 r14043  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Core;
    2324
     
    2526  // a packing shape represents a physical object of correct dimension (2d or 3d)
    2627  // packing bins (containers) and packing items are both packing shapes
    27   public interface IPackingShape : IItem { }
     28  public interface IPackingShape : IItem, IComparable {
     29    int Volume { get; }
     30    void ApplyHorizontalOrientation();
     31  }
    2832}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingMoveEvaluator.cs

    r13608 r14043  
    3838  public abstract class PackingMoveEvaluator<D, B, I> : SingleSuccessorOperator, IPackingMoveEvaluator, IMoveOperator
    3939    where D : class, IPackingDimensions
    40     where B : PackingShape<D>, IPackingBin, IRegularPackingShape
    41     where I : PackingShape<D>, IPackingItem, IRegularPackingShape {     
     40    where B : PackingShape<D>, IPackingBin
     41    where I : PackingShape<D>, IPackingItem {     
    4242    public override bool CanChangeName {
    4343      get { return false; }
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/PackingShape.cs

    r13608 r14043  
    7979    }
    8080
     81    public abstract void ApplyHorizontalOrientation();
     82    public abstract int CompareTo(object obj);
     83
    8184    public IKeyedItemCollection<string, IParameter> Parameters { get; private set; }
    8285  }
  • branches/HeuristicLab.BinPacking/old files/IRegularPackingShape.cs

    r14042 r14043  
    2525  ///A regularPackingShape has special geometric properties that allow special handling = Rectangle, Cuboid
    2626  public interface IRegularPackingShape : IPackingShape, IComparable {
    27     int Volume { get; }
    28     void ApplyHorizontalOrientation();
     27
    2928  }
    3029}
Note: See TracChangeset for help on using the changeset viewer.