Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/21/16 14:33:53 (8 years ago)
Author:
gkronber
Message:

#1966: implemented 3d bin packing problems (using permutation and integer vector encoding) based on the 2d implementations

Location:
branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/BottomLeftIntegerVectorDecoder.cs

    r14151 r14153  
    4646    }
    4747
    48     protected override PackingPosition FindPositionForItem(BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> bp, PackingItem item) {
     48    protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item) {
    4949      return bp.FindPositionBySliding(item, rotated: false);
    5050    }
    5151
    52     protected override BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> CreatePacking(
     52    protected override BinPacking2D CreatePacking(
    5353      Solution partialSolution,
    5454      ref IList<int> remainingIDs, IList<PackingItem> items) {
    55       var bp = partialSolution.NewBinPacking();
     55      var bp = new BinPacking2D(partialSolution.BinMeasures);
    5656      bp.SlidingBasedPacking(ref remainingIDs, items);
    5757      return bp;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/ExtremePointIntegerVectorDecoder.cs

    r14151 r14153  
    4646    }
    4747
    48     protected override PackingPosition FindPositionForItem(BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> bp, PackingItem item) {
     48    protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item) {
    4949      return bp.FindExtremePointForItem(item, false, stackingConstraints: false);
    5050    }
    5151
    52     protected override BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> CreatePacking(
     52    protected override BinPacking2D CreatePacking(
    5353      Solution partialSolution,
    5454      ref IList<int> remainingIDs, IList<PackingItem> items) {
    55       var bp = partialSolution.NewBinPacking();
     55      var bp = new BinPacking2D(partialSolution.BinMeasures);
    5656      bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false);
    5757      return bp;
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/IntegerVectorDecoderBase.cs

    r14151 r14153  
    3939
    4040
    41     public Solution Decode(IntegerVector intVec, PackingShape binShape, IList<PackingItem> items) {
     41    public virtual Solution Decode(IntegerVector intVec, PackingShape binShape, IList<PackingItem> items) {
    4242      var sequenceMatrix = IntegerVectorProblem.GenerateSequenceMatrix(intVec);
    4343      Solution result = CreateSolution(binShape);
     
    5454      var temp = new List<int>(remainingIDs);
    5555      foreach (int id in temp) {
    56         foreach (var bp in result.BinPackings) {
     56        foreach (BinPacking2D bp in result.BinPackings) {
    5757          var position = FindPositionForItem(bp, items[id]);
    5858          if (position != null) {
     
    7070      result.UpdateBinPackings();
    7171
    72       // gkronber: original implementation also updates the encoded solution
     72      // gkronber: original implementation by Helm also updates the encoded solution (TODO)
    7373      // var newSolution = new int[intVec.Length];
    7474      // int binIndex = 0;
     
    8484
    8585    protected abstract Solution CreateSolution(PackingShape binShape);
    86     protected abstract PackingPosition FindPositionForItem(BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> bp, PackingItem item);
    87     protected abstract BinPacking.BinPacking<PackingPosition, PackingShape, PackingItem> CreatePacking(Solution partialSolution, ref IList<int> remainingIDs, IList<PackingItem> items);
     86    protected abstract PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item);
     87    protected abstract BinPacking2D CreatePacking(Solution partialSolution, ref IList<int> remainingIDs, IList<PackingItem> items);
    8888  }
    8989}
  • branches/HeuristicLab.BinPacking/HeuristicLab.Problems.BinPacking.2D/3.3/IntegerVectorEncoding/IntegerVectorProblem.cs

    r14151 r14153  
    6666    private void AddOperators() {
    6767
    68       // move operators are not yet supported
     68      // move operators are not yet supported (TODO)
    6969      Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator);
    7070      Operators.RemoveAll(x => x is SingleObjectiveMoveMaker);
    7171      Operators.RemoveAll(x => x is SingleObjectiveMoveEvaluator);
    7272
    73       Encoding.ConfigureOperators(Operators.OfType<IOperator>());
     73      Encoding.ConfigureOperators(Operators.OfType<IOperator>()); // gkronber: not strictly necessary (only when customer ops are added)
    7474    }
    7575
Note: See TracChangeset for help on using the changeset viewer.