cec2020: implement SchafferExpanded func
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-02-06 22:55:26 +01:00
parent 3922e86625
commit de7b930d77
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ

@ -168,7 +168,17 @@ func Schaffer(x, y float64) float64 {
} }
// SchafferExpanded is the "Expanded Schaffer's Function" of CEC2020. // 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 // Weierstrass is the "Weierstrass Function" of CEC2020 with a=0.5, b=3 and
// kmax=20. // kmax=20.