Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/12/16 16:35:10 (8 years ago)
Author:
gkronber
Message:

#1966: fixed compile errors and reverted some changes from the last commit which prepared for refactoring to use new Encoding framework

File:
1 edited

Legend:

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

    r13612 r14038  
    5959      if (sourcePointX.X < BinMeasures.Width && sourcePointX.Y < BinMeasures.Height) {
    6060        //Traversing down the y-axis       
    61         while (sourcePointX.Y > 0 && !IsPointOccupied(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1))) {
    62           sourcePointX.Y--;
     61        var newPoint = new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1);
     62        while (sourcePointX.Y > 0 && !IsPointOccupied(newPoint)) {
     63          sourcePointX = newPoint;
     64          newPoint = new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y - 1);
    6365        }
    6466        ExtremePoints.Add(new TwoDimensionalPacking(0, sourcePointX.X, sourcePointX.Y));
     
    7274      if (sourcePointY.X < BinMeasures.Width && sourcePointY.Y < BinMeasures.Height) {
    7375        //Traversing down the x-axis 
    74         while (sourcePointY.X > 0 && !IsPointOccupied(new TwoDimensionalPacking(0, sourcePointY.X - 1, sourcePointY.Y))) {
    75           sourcePointY.X--;
     76        var newPoint = new TwoDimensionalPacking(0, sourcePointY.X - 1, sourcePointY.Y);
     77        while (sourcePointY.X > 0 && !IsPointOccupied(newPoint)) {
     78          sourcePointY = newPoint;
     79          newPoint = new TwoDimensionalPacking(0, sourcePointY.X - 1, sourcePointY.Y);
    7680        }
    7781        ExtremePoints.Add(new TwoDimensionalPacking(0, sourcePointY.X, sourcePointY.Y));
     
    96100
    97101      if (epIndex < ExtremePoints.Count) {
    98         var result = ExtremePoints.ElementAt(epIndex);
    99         result.Rotated = rotated;
     102        var currentPoint = ExtremePoints.ElementAt(epIndex);
     103
     104        var result = new TwoDimensionalPacking(currentPoint.AssignedBin, currentPoint.X, currentPoint.Y, rotated);
    100105        return result;
    101106      }
Note: See TracChangeset for help on using the changeset viewer.