43 lines
1.2 KiB
Go
43 lines
1.2 KiB
Go
// Copyright 2022 wanderer <a_mirre at utb dot cz>
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package bench
|
|
|
|
type funcParams struct {
|
|
min float64
|
|
max float64
|
|
}
|
|
|
|
const (
|
|
// Neighbourhood is the number of neighbouring values that are to be
|
|
// generated as part of e.g. Stochastic Hill Climbing algo.
|
|
Neighbourhood = 10
|
|
// MaxFES is the maximum number of allowed function evaluations.
|
|
MaxFES = 10000
|
|
)
|
|
|
|
var (
|
|
// Dimensions to compute for (spatial complexity..?).
|
|
Dimensions = []uint{5, 10, 20}
|
|
|
|
// SchwefelParams is a struct holding the min, max allowed value of inputs
|
|
// passed to the Schwefel function.
|
|
SchwefelParams = funcParams{min: -500.0, max: 500.0}
|
|
// DeJong1Params is a struct holding the min, max allowed value of inputs
|
|
// passed to the De Jong 1st function.
|
|
DeJong1Params = funcParams{min: -5.0, max: 5.0}
|
|
// DeJong2Params is a struct holding the min, max allowed value of inputs
|
|
// passed to the De Jong 2nd function.
|
|
DeJong2Params = funcParams{min: -5.0, max: 5.0}
|
|
)
|
|
|
|
// Min returns the non-exported "min" field of a funcParams struct.
|
|
func (f *funcParams) Min() float64 {
|
|
return f.min
|
|
}
|
|
|
|
// Max returns the non-exported 'max' field of a funcParams struct.
|
|
func (f *funcParams) Max() float64 {
|
|
return f.max
|
|
}
|