Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/07/13 15:35:12 (11 years ago)
Author:
jhelm
Message:

#1966: Fixed a bug which caused the stacking-contraint to be wrongly enforced; Did some cleanup;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Encodings/PackingPlans/BinPacking2D.cs

    r9596 r9598  
    6262      if (sourcePointX.X < BinMeasures.Width && sourcePointX.Y < BinMeasures.Height) {
    6363        //Traversing down the y-axis       
    64         while (sourcePointX.Y > 0 && !IsPointOccupied(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1))) {
     64        while (sourcePointX.Y > 0 && (-1).Equals(IsPointOccupied(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1)))) {
    6565          sourcePointX.Y--;
    6666        }
     
    7575      if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height) {
    7676        //Traversing down the x-axis 
    77         while (sourcePointY.X > 0 && !IsPointOccupied(new TwoDimensionalPacking (0,sourcePointY.X - 1, sourcePointY.Y))) {
     77        while (sourcePointY.X > 0 && (-1).Equals(IsPointOccupied(new TwoDimensionalPacking (0,sourcePointY.X - 1, sourcePointY.Y)))) {
    7878          sourcePointY.X--;
    7979        }
     
    166166    }
    167167
    168 
    169168    public override int ShortestPossibleSideFromPoint(TwoDimensionalPacking position) {
    170169      int shortestSide = int.MaxValue;
Note: See TracChangeset for help on using the changeset viewer.