From 12f0aecd5a2a67506de3d79cc4325662b7fca4ec Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 4 Feb 2023 00:50:13 +0100 Subject: [PATCH] cec2020: add asymptotic func --- bench/cec2020/helperFunctions.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bench/cec2020/helperFunctions.go b/bench/cec2020/helperFunctions.go index 80c8936..64a8817 100644 --- a/bench/cec2020/helperFunctions.go +++ b/bench/cec2020/helperFunctions.go @@ -98,3 +98,17 @@ func ShiftRotate(x []float64, os []float64, mr []float64, shiftRate float64, shi } } } + +// Asy is the asymptotic function. +func Asy(x []float64, beta float64) { + nx := len(x) + + for i := range x { + if x[i] > 0 { + fi := float64(i) + fnx := float64(nx) + + x[i] = math.Pow(x[i], 1+((beta*fi)/(fnx-1)*math.Pow(x[i], 0.5))) + } + } +}