Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/16/18 15:40:43 (6 years ago)
Author:
rhanghof
Message:

#2817:

  • The items can be rotated and tilted now.
  • Added pruning of extreme points in packed bins.
  • Added new packer which packs items by positioning them on the point with the minimum of wasted space. He uses rotating and tilting of items.
  • Added classes for sorting given items.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking/3.3/3D/Packer/BinPackerFirstFit.cs

    r15554 r15617  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2525using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2626using HeuristicLab.Problems.BinPacking3D.ExtremePointCreation;
     27using HeuristicLab.Problems.BinPacking3D.ExtremePointPruning;
    2728using System;
    2829using System.Collections.Generic;
     
    5253    /// </summary>
    5354    /// <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 epGenerationMethod, bool useStackingConstraints) {
     55    public override IList<BinPacking3D> PackItems(Permutation sortedItems, PackingShape binShape, IList<PackingItem> items, ExtremePointCreationMethod epCreationMethod, ExtremePointPruningMethod epPruningMethod, bool useStackingConstraints) {
    5556      IList<BinPacking3D> packingList = new List<BinPacking3D>();
    5657      IList<int> remainingIds = new List<int>(sortedItems);
     
    5859      while (remainingIds.Count > 0) {
    5960        BinPacking3D packingBin = new BinPacking3D(binShape);
    60         PackRemainingItems(ref remainingIds, ref packingBin, items, epGenerationMethod, useStackingConstraints, null);
     61        PackRemainingItems(ref remainingIds, ref packingBin, items, epCreationMethod, useStackingConstraints);
    6162        packingList.Add(packingBin);
    6263      }
    6364
     65      ExtremePointPruningFactory.CreatePruning().PruneExtremePoints(epPruningMethod, packingList);
    6466      return packingList;
    6567    }
     
    6971    /// </summary>
    7072    /// <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>
    7174    /// <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) {
    7478      IExtremePointCreator extremePointCreator = ExtremePointCreatorFactory.CreateExtremePointCreator(epCreationMethod, useStackingConstraints);
    7579      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);
    7881        // if a valid packing position could be found, the current item can be added to the given bin
    7982        if (position != null) {
Note: See TracChangeset for help on using the changeset viewer.