pak

package module
v0.0.0-...-c33eb38 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoxCode

func BoxCode(bb []*Box) (code string)

Types

type Base

type Base struct {
	Scorer
}

func (*Base) FindPositionForNewNode

func (b *Base) FindPositionForNewNode(box *Box, freeRects []*FreeSpaceBox) *Score

type BestAreaFit

type BestAreaFit struct{}

type BestLongSide

type BestLongSide struct{}

type BestShortSide

type BestShortSide struct{}

type BestSimilarRatio

type BestSimilarRatio struct{}

type Bin

type Bin struct {
	W, H           float64
	Boxes          []*Box
	FreeRectangles []*FreeSpaceBox
	Heuristic      *Base
}

func NewBin

func NewBin(w float64, h float64, s *Base) *Bin

func (*Bin) Area

func (b *Bin) Area() float64

func (*Bin) Eficiency

func (b *Bin) Eficiency() float64

func (*Bin) Insert

func (b *Bin) Insert(box *Box) bool

func (*Bin) Label

func (b *Bin) Label() string

type BottomLeft

type BottomLeft struct{}

type Box

type Box struct {
	W, H, X, Y                 float64
	Packed, CanRotate, Rotated bool
}

func NewBox

func NewBox(w, h float64) *Box

func (*Box) Area

func (b *Box) Area() float64

func (*Box) Label

func (b *Box) Label() string

func (*Box) Rotate

func (b *Box) Rotate()

type FreeSpaceBox

type FreeSpaceBox struct {
	W, H, X, Y float64
}

type Packer

type Packer struct {
	// contains filtered or unexported fields
}

func NewPacker

func NewPacker(bins []*Bin) *Packer

type PackerOptions

type PackerOptions struct {
	// contains filtered or unexported fields
}

type Score

type Score struct {
	S1, S2 int
}

func NewScore

func NewScore(s1, s2 int) *Score

func NewScoreBlank

func NewScoreBlank() *Score

func (*Score) Assign

func (s *Score) Assign(o *Score)

func (*Score) Bigger

func (s *Score) Bigger(o *Score) bool

func (*Score) DecreaseBy

func (s *Score) DecreaseBy(delta int)

func (*Score) Equal

func (s *Score) Equal(o *Score) bool

func (*Score) IsBlank

func (s *Score) IsBlank() bool

func (*Score) Smaller

func (s *Score) Smaller(o *Score) bool

type ScoreBoard

type ScoreBoard struct {
	// contains filtered or unexported fields
}

func NewScoreBoard

func NewScoreBoard(bins []*Bin, boxes []*Box) *ScoreBoard

type ScoreBoardEntry

type ScoreBoardEntry struct {
	// contains filtered or unexported fields
}

func NewScoreBoardEntry

func NewScoreBoardEntry(bin *Bin, box *Box) *ScoreBoardEntry

type Scorer

type Scorer interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL