Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BestFitPacker ¶
type BestFitPacker struct{}
BestFitPacker is a packer implementation based on a paper by Dube, E., & Kanavathy, L. (2006)
func NewBestFitPacker ¶
func NewBestFitPacker() BestFitPacker
func (BestFitPacker) Pack ¶
func (bfp BestFitPacker) Pack(boxSpecs []BoxSpec, itemSpecs []ItemSpec) PackingScheme
type Box ¶
type Box struct {
// contains filtered or unexported fields
}
func NewBox ¶
func NewBox(desc string, dims Dimensions) *Box
func (*Box) Dimensions ¶
func (bx *Box) Dimensions() Dimensions
type BoxSpec ¶
type BoxSpec struct {
// contains filtered or unexported fields
}
func NewBoxSpec ¶
func NewBoxSpec(desc string, qty int, dims Dimensions) BoxSpec
type BoxSpecByVolume ¶
type BoxSpecByVolume []BoxSpec
func (BoxSpecByVolume) Len ¶
func (s BoxSpecByVolume) Len() int
func (BoxSpecByVolume) Less ¶
func (s BoxSpecByVolume) Less(i, j int) bool
func (BoxSpecByVolume) Swap ¶
func (s BoxSpecByVolume) Swap(i, j int)
type Dimensions ¶
type Dimensions [3]float32
Dimensions is the dimensions
func NewDimensions ¶
func NewDimensions(length, width, height float32) Dimensions
func (Dimensions) Height ¶
func (d Dimensions) Height() float32
func (Dimensions) Length ¶
func (d Dimensions) Length() float32
func (Dimensions) String ¶
func (d Dimensions) String() string
func (Dimensions) Width ¶
func (d Dimensions) Width() float32
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
func NewItem ¶
func NewItem(desc string, dims Dimensions) *Item
func (*Item) Dimensions ¶
func (i *Item) Dimensions() Dimensions
type ItemSpec ¶
type ItemSpec struct {
// contains filtered or unexported fields
}
func NewItemSpec ¶
func NewItemSpec(desc string, qty int, dims Dimensions) ItemSpec
type ItemSpecByVolume ¶
type ItemSpecByVolume []ItemSpec
func (ItemSpecByVolume) Len ¶
func (s ItemSpecByVolume) Len() int
func (ItemSpecByVolume) Less ¶
func (s ItemSpecByVolume) Less(i, j int) bool
func (ItemSpecByVolume) Swap ¶
func (s ItemSpecByVolume) Swap(i, j int)
type Packer ¶
type Packer interface { // Pack takes a box and item specs and returns a packing scheme Pack([]BoxSpec, []ItemSpec) PackingScheme }
Packer is an interface that wraps the pack method
type PackingScheme ¶
func (PackingScheme) String ¶
func (ps PackingScheme) String() string
Click to show internal directories.
Click to hide internal directories.