Closed sma11black closed 4 years ago
I checked the book Nature-inspired metaheuristic algorithms of the author. At the equation (2.23), Page 16 (chapter 2) of the book:
I think the code should be sigma1 = np.power((np.gamma(1 + Lambda) * np.sin(np.pi * Lambda / 2)) / (np.gamma((1 + Lambda) / 2) * Lambda * np.power(2, (Lambda - 1) / 2)), 1 / Lambda)
The matlab code is
sigma=(gamma(1+beta)*sin(pi*beta/2)/(gamma((1+beta)/2)*beta*2^((beta-1)/2)))^(1/beta);
Your code is
sigma1 = np.power((math.gamma(1 + Lambda) * np.sin((np.pi * Lambda) / 2)) / math.gamma((1 + Lambda) / 2) * np.power(2, (Lambda - 1) / 2), 1 / Lambda)
It seems that your code is missing a Lambda.