|
GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
|
Implementation of Himmelblau's function. More...
#include <HimmelblauFunction.h>
Public Member Functions | |
| HimmelblauFitness ()=default | |
| double | evaluate (const std::vector< GeneType > &phenotype) const override |
| Evaluates the 2D Himmelblau function. | |
| std::size_t | size () const |
| Returns the dimensionality of the optimization problem. | |
| GeneType | getLowerBound (const std::size_t dimension) const override |
| Gets the lower bound for a specific dimension. | |
| GeneType | getUpperBound (const std::size_t dimension) const override |
| Gets the upper bound for a specific dimension. | |
Public Member Functions inherited from galib::FitnessFunction< GeneType > | |
| virtual | ~FitnessFunction ()=default |
| virtual std::string | name () const |
| Short identifier used to select a GPU evaluation kernel. | |
| GeneType | getLowerBound () const |
| Convenience method to get the lower bound of the first dimension. | |
| GeneType | getUpperBound () const |
| Convenience method to get the upper bound of the first dimension. | |
Implementation of Himmelblau's function.
A multi-modal 2D function with 4 identical local minima. Global minima: f(3.0, 2.0) = 0, f(-2.805, 3.131) = 0, f(-3.779, -3.283) = 0, f(3.584, -1.848) = 0.
| GeneType | The numeric type of the genes. |
Definition at line 23 of file HimmelblauFunction.h.
|
default |
|
inlineoverridevirtual |
Evaluates the 2D Himmelblau function.
| phenotype | Must have exactly 2 elements. |
| std::invalid_argument | if phenotype size != 2. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 38 of file HimmelblauFunction.h.
|
inlineoverridevirtual |
Gets the lower bound for a specific dimension.
| dimension | Index of the dimension. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 59 of file HimmelblauFunction.h.
|
inlineoverridevirtual |
Gets the upper bound for a specific dimension.
| dimension | Index of the dimension. |
Implements galib::FitnessFunction< GeneType >.
Definition at line 63 of file HimmelblauFunction.h.
|
inlinevirtual |
Returns the dimensionality of the optimization problem.
Implements galib::FitnessFunction< GeneType >.
Definition at line 55 of file HimmelblauFunction.h.