protected override BinPacking2D CreatePacking(
            Solution partialSolution,
            ref IList <int> remainingIDs, IList <PackingItem> items)
        {
            var bp = new BinPacking2D(partialSolution.BinShape);

            bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false);
            return(bp);
        }
        protected override BinPacking2D CreatePacking(
            Solution partialSolution,
            ref IList <int> remainingIDs, IList <PackingItem> items)
        {
            var bp = new BinPacking2D(partialSolution.BinShape);

            bp.SlidingBasedPacking(ref remainingIDs, items);
            return(bp);
        }
        public Solution Decode(Permutation permutation, PackingShape binShape, IList <PackingItem> items)
        {
            Solution    result       = new Solution(binShape, useExtremePoints: true, stackingConstraints: false);
            IList <int> remainingIDs = new List <int>(permutation);

            while (remainingIDs.Count > 0)
            {
                var bp = new BinPacking2D(binShape);
                bp.ExtremePointBasedPacking(ref remainingIDs, items, stackingConstraints: false);
                result.Bins.Add(bp);
            }
            result.UpdateBinPackings();
            return(result);
        }
 protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item)
 {
     return(bp.FindExtremePointForItem(item, false, stackingConstraints: false));
 }
Esempio n. 5
0
 protected abstract PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item);
Esempio n. 6
0
 protected BinPacking2D(BinPacking2D original, Cloner cloner)
     : base(original, cloner)
 {
     this.ExtremePoints = new SortedSet <PackingPosition>(original.ExtremePoints.Select(p => cloner.Clone(p)));
 }
 protected override PackingPosition FindPositionForItem(BinPacking2D bp, PackingItem item)
 {
     return(bp.FindPositionBySliding(item, rotated: false, stackingConstraints: false));
 }
Esempio n. 8
0
 protected BinPacking2D(BinPacking2D original, Cloner cloner) : base(original, cloner)
 {
 }