polarcbo.objectives.three_hump_camel
- class polarcbo.objectives.three_hump_camel[source]
Bases:
objective
Three-hump camel function
Three-hump camel function is a multimodal function with 2 global minima at \((0,0)\) and \((0,0)\). The function is defined as
\[f(x,y) = 2x^2 - 1.05x^4 + \frac{1}{6}x^6 + xy + y^2\]Examples
>>> import numpy as np >>> from polarcbo.objectives import three_hump_camel >>> x = np.array([[1,2], [3,4], [5,6.]]) >>> obj = three_hump_camel() >>> obj(x) array([ 7.11666667, 82.45 , 2063.91666667])
- __call__(x)[source]
Call method for classes that inherit from
objective
- Parameters:
x (array_like, shape (J, d)) – For a system of \(J\) particles, the i-th row of this array
x[i,:]
represents the position of the i-th particle.- Returns:
y – The value of the objective function at the positions
x
.- Return type:
array_like, shape (J,)