Documentation
¶
Overview ¶
Package bench provides implementations of functions used for benchmarking.
Index ¶
Constants ¶
View Source
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 ¶
View Source
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 */} )
View Source
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.
View Source
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.
View Source
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 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
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.