Changeset 15617 for branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs
- Timestamp:
- 01/16/18 15:40:43 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs
r15554 r15617 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 6 Joseph Helm andHeuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 26 using HeuristicLab.Problems.BinPacking3D.ExtremePointCreation; 27 using HeuristicLab.Problems.BinPacking3D.ExtremePointPruning; 27 28 using System; 28 29 using System.Collections.Generic; … … 52 53 /// </summary> 53 54 /// <returns>Returns a collection of bin packing 3d objects. Each object represents a bin and the packed items</returns> 54 public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod ep GenerationMethod, bool useStackingConstraints) {55 public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints) { 55 56 IList<BinPacking3D> packingList = new List<BinPacking3D>(); 56 57 IList<int> remainingIds = new List<int>(sortedItems); … … 58 59 while (remainingIds.Count > 0) { 59 60 BinPacking3D packingBin = new BinPacking3D(binShape); 60 PackRemainingItems(ref remainingIds, ref packingBin, items, ep GenerationMethod, useStackingConstraints, null);61 PackRemainingItems(ref remainingIds, ref packingBin, items, epCreationMethod, useStackingConstraints); 61 62 packingList.Add(packingBin); 62 63 } 63 64 65 ExtremePointPruningFactory.CreatePruning().PruneExtremePoints(epPruningMethod, packingList); 64 66 return packingList; 65 67 } … … 69 71 /// </summary> 70 72 /// <param name="remainingIds">List of remaining ids. After the method has been executed the list has to have less items</param> 73 /// <param name="packingBin">This object will be filled with some of the given items</param> 71 74 /// <param name="items">List of packing items. Some of the items will be assigned to the BinPacking3D object</param> 72 /// <param name="packingBin">This object will be filled with some of the given items</param> 73 protected void PackRemainingItems(ref IList<int> remainingIds, ref BinPacking3D packingBin, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints, Dictionary<int, bool> rotationArray) { 75 /// <param name="epCreationMethod"></param> 76 /// <param name="useStackingConstraints"></param> 77 protected void PackRemainingItems(ref IList<int> remainingIds, ref BinPacking3D packingBin, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, bool useStackingConstraints) { 74 78 IExtremePointCreator extremePointCreator = ExtremePointCreatorFactory.CreateExtremePointCreator(epCreationMethod, useStackingConstraints); 75 79 foreach (var itemId in new List<int>(remainingIds)) { 76 bool rotated = rotationArray == null ? false : rotationArray[itemId]; 77 PackingPosition position = FindPackingPositionForItem(packingBin, items[itemId], useStackingConstraints, rotated); 80 PackingPosition position = FindPackingPositionForItem(packingBin, items[itemId], useStackingConstraints); 78 81 // if a valid packing position could be found, the current item can be added to the given bin 79 82 if (position != null) {
Note: See TracChangeset
for help on using the changeset viewer.