Changeset 14052
- Timestamp:
- 07/12/16 20:41:14 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking/3.3/Evaluators/EvaluatorBase.cs
r14051 r14052 80 80 return base.Apply(); 81 81 } 82 83 protected bool HasOverlappingOrNotContainedItems(ObservableDictionary<int, D> positions, B binMeasure, ItemList<I> itemMeasures, int nrOfBins) {84 //TODO: Optimize performance by removing unnecessary allocations..85 for (int i = 0; i < itemMeasures.Count; i++) {86 I packingItem = itemMeasures[i];87 D currentPosition = positions[i];88 if (!binMeasure.Encloses(currentPosition, packingItem))89 return true;90 91 for (int j = 0; j < itemMeasures.Count; j++) {92 D checkedPosition = positions[j];93 if (i != j && currentPosition.AssignedBin == checkedPosition.AssignedBin) {94 I checkedItem = itemMeasures[j];95 if (packingItem.Overlaps(currentPosition, checkedPosition, checkedItem))96 return true;97 }98 }99 }100 return false;101 }102 82 } 103 83 }
Note: See TracChangeset
for help on using the changeset viewer.