package bench
import "git.dotya.ml/wanderer/math-optim/bench"
Package bench provides implementations of functions used for benchmarking.
Index ¶
- Constants
- Variables
- func DeJong1st(x []float64) float64
- func DeJong2nd(x []float64) float64
- func GetGAMaxFES(dim int) int
- func NewfuncParams(min, max float64) *funcParams
- func Rastrigin(x []float64) float64
- func Schwefel(x []float64) float64
Constants ¶
const ( // Neighbourhood is the number of neighbouring values that are to be // generated as part of e.g. Stochastic Hill Climbing algo. Neighbourhood = 10 // MaxNeighbourVariancePercent covers an arbitrary task requirement: pick // neighbours from max n percent of search space. MaxNeighbourVariancePercent = 10 // MaxFES is the maximum number of allowed function evaluations. MaxFES = 10000 )
Variables ¶
var ( // Dimensions to compute for (spatial complexity..?). Dimensions = []int{5, 10, 20} // DimensionsGA are used with Genetic Algorithms (such as DE, see algo/de). DimensionsGA = []int{10, 30} // SchwefelParams is a struct holding the min, max allowed value of inputs // passed to the Schwefel function. SchwefelParams = funcParams{/* contains filtered or unexported fields */} // DeJong1Params is a struct holding the min, max allowed value of inputs // passed to the De Jong 1st function. DeJong1Params = funcParams{/* contains filtered or unexported fields */} // DeJong2Params is a struct holding the min, max allowed value of inputs // passed to the De Jong 2nd function. DeJong2Params = funcParams{/* contains filtered or unexported fields */} // RastriginParams is a struct holding the min, max allowed value of inputs // passed to the Rastrigin function. RastriginParams = funcParams{/* contains filtered or unexported fields */} )
var FuncNames = map[int]string{ 0: "Schwefel", 1: "De Jong 1st", 2: "De Jong 2nd", 3: "Rastrigin", }
FuncNames represents a numbered list of function name.
var FunctionParams = map[string]funcParams{ "Schwefel": SchwefelParams, "De Jong 1st": DeJong1Params, "De Jong 2nd": DeJong2Params, "Rastrigin": RastriginParams, }
Function params maps function names to their funcParams for easier iterable access.
var Functions = map[string]func([]float64) float64{ "Schwefel": Schwefel, "De Jong 1st": DeJong1st, "De Jong 2nd": DeJong2nd, "Rastrigin": Rastrigin, }
Functions is a string-func map of function names and specific bench funcs for easier iterable access.
Functions ¶
func DeJong1st ¶
DeJong1st computes the value of the 1st De Jong function for x.
func DeJong2nd ¶
DeJong2nd computes the value of the 2nd De Jong function for x.
func GetGAMaxFES ¶
GetGAMaxFES calculates the value of MaxFES for Genetic Algorithms. This is an arbitrary specification where MaxFES is 5000xD.
func NewfuncParams ¶
func NewfuncParams(min, max float64) *funcParams
NewfuncParams returns a pointer to a fresh instance of funcParams. nolint: revive
func Rastrigin ¶
Rastrigin computes the value of the Rastrigin function for x. ref: https://www.sfu.ca/~ssurjano/rastr.html
func Schwefel ¶
Schwefel computes the value of the Schwefel function for x.
Source Files ¶
bench.go doc.go functions.go
Directories ¶
Path | Synopsis |
---|---|
bench/cec2020 | Package cec2020 implements functions of the CEC2020 Testbed. |
- Version
- v0.0.0-20230224152531-7a5de808e98c (latest)
- Published
- Feb 24, 2023
- Platform
- linux/amd64
- Imports
- 2 packages
- Last checked
- 1 month ago –
Tools for package owners.