def rosenbrock(x): x = normalization(x, x_min, x_max) result = 0 for i in range(len(x)-1): result += 100*(x[i+1]-x[i]**2)**2 + (x[i] - 1)**2 return result
def rastrigin(x): x = normalization(x) result = 0 for elem in x: result += elem**2 - 10*cos(2*pi*elem) + 10 return result
def schwefel(x): x = normalization(x, x_min, x_max) result = 0 for elem in x: result += (-1*elem)*sin(sqrt(abs(elem))) return result