cec2020: implement SchafferExpanded func
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
3922e86625
commit
de7b930d77
@ -168,7 +168,17 @@ func Schaffer(x, y float64) float64 {
|
||||
}
|
||||
|
||||
// SchafferExpanded is the "Expanded Schaffer's Function" of CEC2020.
|
||||
func SchafferExpanded(x []float64) float64 { return 0 }
|
||||
func SchafferExpanded(x []float64) float64 {
|
||||
var sum float64
|
||||
|
||||
nx := len(x)
|
||||
|
||||
for i := range x {
|
||||
sum += Schaffer(x[i], x[i%nx])
|
||||
}
|
||||
|
||||
return sum
|
||||
}
|
||||
|
||||
// Weierstrass is the "Weierstrass Function" of CEC2020 with a=0.5, b=3 and
|
||||
// kmax=20.
|
||||
|
Loading…
Reference in New Issue
Block a user