Documentation ¶
Index ¶
- func AscendingBucketSizeReorder(bucketSizes []int) []int
- func AscendingRelativeSizeReorder(bucketSizes []int, items [][]int) []int
- func AscendingTotalSizeOfItemsInBucketReorder(bucketSizes []int, items [][]int) []int
- func DescendingBucketSizeReorder(bucketSizes []int) []int
- func DescendingRelativeSizeReorder(bucketSizes []int, items [][]int) []int
- func DescendingTotalSizeOfItemsInBucketReorder(bucketSizes []int, items [][]int) []int
- func NoOpReorder(bucketSizes []int) []int
- func NoOpReorderByItems(bucketSizes []int, _ [][]int) []int
- func RandomReorder(bucketSizes []int) []int
- func ToResult(vehicleAssignment []int, n int) *optimizer.Result
- type Bucket
- type PriorityBucketQueue
- func (pq PriorityBucketQueue) At(index int) *Bucket
- func (pq *PriorityBucketQueue) Decrease(b *Bucket, decreaseAmount int)
- func (pq PriorityBucketQueue) Len() int
- func (pq PriorityBucketQueue) Less(i, j int) bool
- func (pq *PriorityBucketQueue) Pop() interface{}
- func (pq *PriorityBucketQueue) PopEmptiestBucket() *Bucket
- func (pq *PriorityBucketQueue) Push(x interface{})
- func (pq *PriorityBucketQueue) PushBucket(bucket *Bucket)
- func (pq PriorityBucketQueue) Swap(i, j int)
- type ReorderBucketsByItemsFunc
- type ReorderBucketsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AscendingBucketSizeReorder ¶
AscendingBucketSizeReorder sorts buckets by their size ascending.
func AscendingRelativeSizeReorder ¶
AscendingRelativeSizeReorder sorts buckets by the total sum of possible items' sizes divided by bucket size in ascending order. Such an approach results in relative ordering: the lower the sum of possible items' sizes in the bucket and the bigger the bucket size, the better.
func AscendingTotalSizeOfItemsInBucketReorder ¶
AscendingTotalSizeOfItemsInBucketReorder sorts buckets by the total sum of possible items' sizes in the bucket in ascending order.
func DescendingBucketSizeReorder ¶
DescendingBucketSizeReorder sorts buckets by their size descending.
func DescendingRelativeSizeReorder ¶
DescendingRelativeSizeReorder sorts buckets by the total sum of possible items' sizes divided by bucket size in descending order. Such an approach results in relative ordering: the higher the sum of possible items' sizes in the bucket and the smaller the bucket size, the better.
func DescendingTotalSizeOfItemsInBucketReorder ¶
DescendingTotalSizeOfItemsInBucketReorder sorts buckets by the total sum of possible items' sizes in the bucket in descending order.
func NoOpReorder ¶
NoOpReorder doesn't change anything in buckets' order. It returns the initial order of buckets.
func NoOpReorderByItems ¶
NoOpReorderByItems doesn't change anything in buckets' order. It returns the initial order of buckets.
func RandomReorder ¶
RandomReorder permutes buckets in a random fashion.
Types ¶
type PriorityBucketQueue ¶
type PriorityBucketQueue []*Bucket
func NewPriorityBucketQueue ¶
func NewPriorityBucketQueue(bucketSizes []int) PriorityBucketQueue
func (PriorityBucketQueue) At ¶
func (pq PriorityBucketQueue) At(index int) *Bucket
func (*PriorityBucketQueue) Decrease ¶
func (pq *PriorityBucketQueue) Decrease(b *Bucket, decreaseAmount int)
func (PriorityBucketQueue) Len ¶
func (pq PriorityBucketQueue) Len() int
func (PriorityBucketQueue) Less ¶
func (pq PriorityBucketQueue) Less(i, j int) bool
func (*PriorityBucketQueue) Pop ¶
func (pq *PriorityBucketQueue) Pop() interface{}
func (*PriorityBucketQueue) PopEmptiestBucket ¶
func (pq *PriorityBucketQueue) PopEmptiestBucket() *Bucket
func (*PriorityBucketQueue) Push ¶
func (pq *PriorityBucketQueue) Push(x interface{})
func (*PriorityBucketQueue) PushBucket ¶
func (pq *PriorityBucketQueue) PushBucket(bucket *Bucket)
func (PriorityBucketQueue) Swap ¶
func (pq PriorityBucketQueue) Swap(i, j int)
type ReorderBucketsByItemsFunc ¶
ReorderBucketsByItemsFunc is a function that defines the order in which buckets will be used during optimization. It is similar to ReorderBucketsFunc but also takes into account items inside the buckets.
type ReorderBucketsFunc ¶
ReorderBucketsFunc is a function that defines the order in which buckets will be used during optimization. It defines the order based on the size of buckets available.