cec2020: add GetMaxFES
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9fdce17516
commit
99c39537fe
@ -98,6 +98,18 @@ func Asy(x []float64, beta float64) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetMaxFES returns maxFES for the passed dimension, given that it's present
|
||||
// in the MaxFES slice, returns -1 otherwise.
|
||||
func GetMaxFES(dim int) int {
|
||||
for i, d := range Dimensions {
|
||||
if dim == d {
|
||||
return MaxFES[i]
|
||||
}
|
||||
}
|
||||
|
||||
return -1
|
||||
}
|
||||
|
||||
func newXopt(n int, mu0 float64) []float64 {
|
||||
gaussDist := &distuv.Normal{
|
||||
Src: rand.NewSource(uint64(time.Now().UnixNano())),
|
||||
|
@ -59,13 +59,4 @@ var (
|
||||
3000000,
|
||||
10000000,
|
||||
}
|
||||
// Dim2MaxFES glues Dimensions and MaxFES together.
|
||||
Dim2MaxFES = map[int]int{}
|
||||
)
|
||||
|
||||
// init antipattern is "necessary" here to fill the map.
|
||||
func init() {
|
||||
for i := range Dimensions {
|
||||
Dim2MaxFES[Dimensions[i]] = MaxFES[i]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user