コード例 #1
0
        protected override BinPacking3D CreatePacking(
            Solution partialSolution,
            ref IList <int> remainingIDs, IList <PackingItem> items, bool useStackingConstraints)
        {
            var bp = new BinPacking3D(partialSolution.BinShape);

            bp.SlidingBasedPacking(ref remainingIDs, items);
            return(bp);
        }
コード例 #2
0
        public Solution Decode(Permutation permutation, PackingShape binShape, IList <PackingItem> items, bool useStackingConstraints)
        {
            Solution    result       = new Solution(binShape, useExtremePoints: false, stackingConstraints: useStackingConstraints);
            IList <int> remainingIDs = new List <int>(permutation);

            while (remainingIDs.Count > 0)
            {
                var bp = new BinPacking3D(binShape);
                bp.SlidingBasedPacking(ref remainingIDs, items, useStackingConstraints);
                result.Bins.Add(bp);
            }
            result.UpdateBinPackings();
            return(result);
        }