Changeset 15820 for branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/ExtremePointPruning/ExtremePointPruning.cs
- Timestamp:
- 02/28/18 14:05:31 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/ExtremePointPruning/ExtremePointPruning.cs
r15731 r15820 28 28 namespace HeuristicLab.Problems.BinPacking3D.ExtremePointPruning { 29 29 internal class ExtremePointPruning : IExtremePointPruning { 30 public void PruneExtremePoints(ExtremePointPruningMethod pruningMethod, PackingShape bin, Dictionary<BinPacking3D, List<KeyValuePair<int, PackingPosition>>> positions) { 31 if (pruningMethod == ExtremePointPruningMethod.PruneBehind) { 32 PruneExtremePointsBehind(bin, positions); 33 } 30 public void PruneExtremePoints(PackingShape bin, Dictionary<BinPacking3D, List<KeyValuePair<int, PackingPosition>>> positions) { 31 PruneExtremePointsBehind(bin, positions); 34 32 } 35 33 36 public void PruneExtremePoints( ExtremePointPruningMethod pruningMethod,IList<BinPacking3D> binPackings) {34 public void PruneExtremePoints(IList<BinPacking3D> binPackings) { 37 35 if (binPackings.Count <= 0) { 38 36 return; … … 47 45 } 48 46 PruneExtremePointsBehind(binPackings[0].BinShape, fixedPositions); 47 } 48 49 public void PruneExtremePoints(BinPacking3D binPacking, int layer) { 50 var pruningPositions = new List<KeyValuePair<int, PackingPosition>>(); 51 var pruning = new Dictionary<BinPacking3D, List<KeyValuePair<int, PackingPosition>>>(); 52 pruning.Add(binPacking, pruningPositions); 53 foreach (var item in binPacking.Items.Where(x => x.Value.Layer <= layer)) { 54 pruningPositions.Add(new KeyValuePair<int, PackingPosition>(item.Key, binPacking.Positions[item.Key])); 55 } 56 57 PruneExtremePointsBehind(binPacking.BinShape, pruning); 49 58 } 50 59
Note: See TracChangeset
for help on using the changeset viewer.