PHP Класс DVDoug\BoxPacker\VolumePacker

Автор: Doug Wright
Наследование: implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$box DVDoug\BoxPacker\Box Box to pack items into
$depthLeft integer Remaining depth of the box to pack items into
$items ItemList List of items to be packed
$lengthLeft integer Remaining length of the box to pack items into
$remainingWeight integer Remaining weight capacity of the box
$widthLeft integer Remaining width of the box to pack items into

Открытые методы

Метод Описание
__construct ( DVDoug\BoxPacker\Box $box, ItemList $items ) Constructor
pack ( ) : DVDoug\BoxPacker\PackedBox Pack as many items as possible into specific given box

Защищенные методы

Метод Описание
findBestOrientation ( DVDoug\BoxPacker\Item $item, OrientatedItem $prevItem = null, DVDoug\BoxPacker\Item $nextItem = null, integer $widthLeft, integer $lengthLeft, integer $depthLeft ) : OrientatedItem | false Get the best orientation for an item
findPossibleOrientations ( DVDoug\BoxPacker\Item $item, OrientatedItem $prevItem = null, integer $widthLeft, integer $lengthLeft, integer $depthLeft ) : OrientatedItem[] Find all possible orientations for an item
isLayerStarted ( integer $layerWidth, integer $layerLength, integer $layerDepth ) : boolean
tryAndStackItemsIntoSpace ( ItemList $packedItems, integer $maxWidth, integer $maxLength, integer $maxDepth ) Figure out if we can stack the next item vertically on top of this rather than side by side Used when we've packed a tall item, and have just put a shorter one next to it

Описание методов

__construct() публичный Метод

Constructor
public __construct ( DVDoug\BoxPacker\Box $box, ItemList $items )
$box DVDoug\BoxPacker\Box
$items ItemList

findBestOrientation() защищенный Метод

Get the best orientation for an item
protected findBestOrientation ( DVDoug\BoxPacker\Item $item, OrientatedItem $prevItem = null, DVDoug\BoxPacker\Item $nextItem = null, integer $widthLeft, integer $lengthLeft, integer $depthLeft ) : OrientatedItem | false
$item DVDoug\BoxPacker\Item
$prevItem OrientatedItem
$nextItem DVDoug\BoxPacker\Item
$widthLeft integer
$lengthLeft integer
$depthLeft integer
Результат OrientatedItem | false

findPossibleOrientations() защищенный Метод

Find all possible orientations for an item
protected findPossibleOrientations ( DVDoug\BoxPacker\Item $item, OrientatedItem $prevItem = null, integer $widthLeft, integer $lengthLeft, integer $depthLeft ) : OrientatedItem[]
$item DVDoug\BoxPacker\Item
$prevItem OrientatedItem
$widthLeft integer
$lengthLeft integer
$depthLeft integer
Результат OrientatedItem[]

isLayerStarted() защищенный Метод

protected isLayerStarted ( integer $layerWidth, integer $layerLength, integer $layerDepth ) : boolean
$layerWidth integer
$layerLength integer
$layerDepth integer
Результат boolean

pack() публичный Метод

Pack as many items as possible into specific given box
public pack ( ) : DVDoug\BoxPacker\PackedBox
Результат DVDoug\BoxPacker\PackedBox packed box

tryAndStackItemsIntoSpace() защищенный Метод

Figure out if we can stack the next item vertically on top of this rather than side by side Used when we've packed a tall item, and have just put a shorter one next to it
protected tryAndStackItemsIntoSpace ( ItemList $packedItems, integer $maxWidth, integer $maxLength, integer $maxDepth )
$packedItems ItemList
$maxWidth integer
$maxLength integer
$maxDepth integer

Описание свойств

$box защищенное свойство

Box to pack items into
protected Box,DVDoug\BoxPacker $box
Результат DVDoug\BoxPacker\Box

$depthLeft защищенное свойство

Remaining depth of the box to pack items into
protected int $depthLeft
Результат integer

$items защищенное свойство

List of items to be packed
protected ItemList,DVDoug\BoxPacker $items
Результат ItemList

$lengthLeft защищенное свойство

Remaining length of the box to pack items into
protected int $lengthLeft
Результат integer

$remainingWeight защищенное свойство

Remaining weight capacity of the box
protected int $remainingWeight
Результат integer

$widthLeft защищенное свойство

Remaining width of the box to pack items into
protected int $widthLeft
Результат integer