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/BinPacking.cs

    r9596 r9598  
    105105    }
    106106
     107
     108    public int PointOccupation(D position) {
     109      foreach (var ipEntry in ItemPositions) {
     110        if (ItemMeasures[ipEntry.Key].EnclosesPoint(ipEntry.Value, position))
     111          return ipEntry.Key;
     112      }
     113      return -1;
     114    }
    107115    public bool IsPointOccupied(D position) {
    108116      foreach (var ipEntry in ItemPositions) {
     
    110118          return true;
    111119      }
    112 
    113120      return false;
    114121    }
    115122    public bool IsPositionFeasible(I currentItem, D position) {
    116       //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the item does not collide with another already packed item
     123      //In this case feasability is defined as following: 1. the item fits into the bin-borders; 2. the point is supported by something; 3. the item does not collide with another already packed item
    117124      if (!BinMeasures.Encloses(position, currentItem))
    118125        return false;
     
    127134    public abstract int ShortestPossibleSideFromPoint (D position);
    128135    public abstract bool IsStaticStable (I item, D position);
    129    
    130     //public bool IsPositionFeasible1(I currentItem, D position) {
    131     //  if (!BinMeasures.Encloses(position, currentItem))
    132     //    return false;
    133 
    134     //  return OccupiedPoints.IsPositionFeasible (currentItem, position);
    135     //}
    136136  }   
    137137}
Note: See TracChangeset for help on using the changeset viewer.