Documentation ¶
Index ¶
- Variables
- func AddBox(box *Box)
- func AddItem(item *Item, qty int)
- func Debugf(format string, args ...interface{})
- func Errorf(format string, args ...interface{})
- func ItemCompare(i, j MinHeapable) bool
- func NewPacker()
- func RedistributeWeight(originalBoxes MinHeap)
- func Report(packedBoxes *MinHeap)
- func Uline()
- type Box
- type Item
- type MinHeap
- func (mh *MinHeap) AtIndex(i int) (x MinHeapable, err error)
- func (mh *MinHeap) Copy() *MinHeap
- func (mh *MinHeap) ItemAtIndex(i int) (x Item, err error)
- func (mh MinHeap) Len() int
- func (mh MinHeap) Less(i, j int) bool
- func (mh *MinHeap) Peek() interface{}
- func (mh *MinHeap) PeekBox() *Box
- func (mh *MinHeap) PeekItem() *Item
- func (mh *MinHeap) PeekPackedBox() *PackedBox
- func (mh *MinHeap) Pop() interface{}
- func (mh *MinHeap) PopBox() *Box
- func (mh *MinHeap) PopItem() *Item
- func (mh *MinHeap) PopPackedBox() *PackedBox
- func (mh *MinHeap) Push(item interface{})
- func (mh *MinHeap) PushBox(box Box)
- func (mh *MinHeap) PushItem(item Item)
- func (mh *MinHeap) PushPackedBox(packedbox PackedBox)
- func (mh *MinHeap) RemoveAt(i int) (err error)
- func (mh MinHeap) Swap(i, j int)
- type MinHeapable
- type PackedBox
- type PackerMinHeapInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HEAP_ERR_NOT_PACKEDBOX = "The type of the object being returned is not PackedBox." HEAP_ERR_NOT_BOX = "The type of the object being returned is not Box." HEAP_ERR_NOT_ITEM = "The type of the object being returned is not Item." HEAP_ERR_NOT_HEAPABLE = "Proper interface is not implemented on this object." HEAP_ERR_INDEX_OUT_OF_BOUNDS = "Given index is out of bounds." )
Functions ¶
func ItemCompare ¶
func ItemCompare(i, j MinHeapable) bool
func RedistributeWeight ¶
func RedistributeWeight(originalBoxes MinHeap)
Given a solution set of packed boxes, repack them to achieve optimum weight distribution
Types ¶
type Box ¶
type Box struct { Reference string OuterWidth int OuterLength int OuterDepth int EmptyWeight int InnerWidth int InnerLength int InnerDepth int InnerVolume int MaxWeight int }
func CalcOuterDims ¶
func CalcVolBox ¶
func NewTestBox ¶
func (Box) BoxInnerVolume ¶
type MinHeap ¶
type MinHeap []MinHeapable
func NewMinHeap ¶
func NewMinHeap() *MinHeap
func (*MinHeap) AtIndex ¶
func (mh *MinHeap) AtIndex(i int) (x MinHeapable, err error)
Returns the item at index i
func (*MinHeap) PeekPackedBox ¶
func (*MinHeap) PopPackedBox ¶
func (*MinHeap) PushItem ¶
Additional functions; wrappers to make sure the indended type is what is put in; satisfies PackerMinHeapInterface Could be replaced by Push itself.
func (*MinHeap) PushPackedBox ¶
type MinHeapable ¶
type PackedBox ¶
type PackedBox struct { Box Box Items MinHeap Weight int RemainingWidth int RemainingLength int RemainingDepth int RemainingWeight int }
func NewPackedBox ¶
func VolumePackerPack ¶
func (PackedBox) BoxInnerVolume ¶
Click to show internal directories.
Click to hide internal directories.