Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/24/18 17:15:15 (7 years ago)
Author:
rhanghof
Message:

#2817:

  • Little changes on the packer
File:
1 edited

Legend:

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

    r15617 r15652  
    102102      var pruningMethod = ExtremePointPruningMethod.None;
    103103      Solution solution = new Solution(binShape, useExtremePoints: true, stackingConstraints: useStackingConstraints);
    104       foreach (var packedBin in binPacker.PackItems(permutation, binShape, items, ExtremePointCreationMethod, pruningMethod, useStackingConstraints)) {
     104     
     105      IList<BinPacking3D> packingList = binPacker.PackItems(permutation, binShape, items, ExtremePointCreationMethod, pruningMethod, useStackingConstraints);
     106      foreach (var packedBin in packingList) {
    105107        solution.Bins.Add(packedBin);
    106108      }
    107109      return solution;
    108110    }
     111
     112    Permutation AddOffset(Permutation p, int offset) {
     113      var s = p.ToArray();
     114      for (int i = 0; i < s.Length; i++) {
     115        s[i] += offset;
     116      }
     117     
     118      return new Permutation(PermutationTypes.Absolute, s);
     119    }
    109120  }
    110121}
Note: See TracChangeset for help on using the changeset viewer.