Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/09/18 15:46:53 (7 years ago)
Author:
rhanghof
Message:

#2817:

  • Bugfixes for the line projection based extreme point creation
  • Bugfixes for the tests
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/ExtremePointCreation/ExtremePointCreator.cs

    r15554 r15585  
    2020
    2121    /// <summary>
    22     /// Updates the residual space for a given bin packing
     22    /// Updates the residual space for a given bin packing.
    2323    /// </summary>
    2424    /// <param name="binPacking"></param>
     
    2626    /// <param name="position"></param>
    2727    protected abstract void UpdateResidualSpace(BinPacking3D binPacking, PackingItem item, PackingPosition position);
     28
     29    /// <summary>
     30    /// Adds an extreme point to the bin packing.
     31    /// </summary>
     32    /// <param name="binPacking"></param>
     33    /// <param name="position"></param>
     34    /// <returns></returns>
    2835    protected abstract bool AddExtremePoint(BinPacking3D binPacking, PackingPosition position);
    2936
     
    214221
    215222    /// <summary>
    216     /// Returns true, if the given poisition and the related residual space is within the residual space of the given extreme point
    217     /// </summary>
    218     /// <param name="pos"></param>
     223    /// Returns true, if the given poisition (pos) and the related residual space is within any residual space of the given extreme point (ep).
     224    /// </summary>
     225    /// <param name="pos">Given poisition</param>
    219226    /// <param name="rsPos"></param>
    220     /// <param name="ep"></param>
     227    /// <param name="ep">Given extreme point</param>
    221228    /// <param name="rsEp"></param>
    222229    /// <returns></returns>
     
    226233
    227234    /// <summary>
    228     /// Returns true, if the given poisition and the related residual space is within the residual space of the given extreme point
    229     /// </summary>
    230     /// <param name="pos"></param>
     235    /// Returns true, if the given poisition (pos) and the related residual space is within the residual space of the given extreme point (ep).
     236    /// </summary>
     237    /// <param name="pos">Given poisition</param>
    231238    /// <param name="rsPos"></param>
    232     /// <param name="ep"></param>
     239    /// <param name="ep">Given extreme point</param>
    233240    /// <param name="rsEp"></param>
    234241    /// <returns></returns>
    235242    protected virtual bool IsWithinResidualSpaceOfAnotherExtremePoint(Vector3D pos, ResidualSpace rsPos, PackingPosition ep, ResidualSpace rsEp) {
     243      /*old implementation
    236244      return rsEp.Width >= pos.X - ep.X + rsPos.Width
    237245          && rsEp.Height >= pos.Y - ep.Y + rsPos.Height
    238           && rsEp.Depth >= pos.Z - ep.Z + rsPos.Depth;
     246          && rsEp.Depth >= pos.Z - ep.Z + rsPos.Depth;*/
     247
     248      var x = pos.X >= ep.X && pos.X + rsPos.Width <= ep.X + rsEp.Width;
     249      var y = pos.Y >= ep.Y && pos.Y + rsPos.Height <= ep.Y + rsEp.Height;
     250      var z = pos.Z >= ep.Z && pos.Z + rsPos.Depth <= ep.Z + rsEp.Depth;
     251
     252      return x && y && z;
    239253    }
    240254
Note: See TracChangeset for help on using the changeset viewer.