bucketpoolbestfit

package
v0.0.0-...-80c8c53 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BucketPoolBestFit

type BucketPoolBestFit struct {
	InitPoolSize int
	helper.ReorderBucketsFunc
	bestfit.FitnessFunc
}

BucketPoolBestFit is an optimizer that implements the enhanced best-fit algorithm with bucket pool, expanded to solve the bin packing problem with heterogeneous bins and items with different sizes that depend on the bin choice. The goal of using a bucket pool is the reduction of available buckets to assign in a given moment during execution. The algorithm uses bestfit.FitnessFunc to choose "best" bucket. ReorderBucketsFunc defines the order in which buckets will be added to the pool. InitPoolSize sets the initial size of a pool. The implementation works in O(v*n) time.

func (BucketPoolBestFit) Optimize

func (b BucketPoolBestFit) Optimize(ctx context.Context, data *data.Data) (*optimizer.Result, error)

Jump to

Keyboard shortcuts

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