PHP 클래스 DVDoug\BoxPacker\VolumePacker

저자: Doug Wright
상속: implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait
파일 보기 프로젝트 열기: dvdoug/boxpacker 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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