pass::rastrigin_function Class Reference

#include <rastrigin_function.hpp>

Inheritance diagram for pass::rastrigin_function:
Collaboration diagram for pass::rastrigin_function:

Public Member Functions

 rastrigin_function (const arma::uword dimension)
 
double evaluate (const arma::vec &agent) const override
 
- Public Member Functions inherited from pass::problem
arma::vec bounds_range () const noexcept
 
arma::uword dimension () const noexcept
 
 problem (const arma::uword dimension, const double lower_bound, const double upper_bound, const std::string &name)
 
 problem (const arma::vec &lower_bounds, const arma::vec &upper_bounds, const std::string &name)
 
double evaluate_normalised (const arma::vec &normalised_agent) const
 
arma::mat normalised_random_agents (const arma::uword count) const
 
arma::mat normalised_hammersley_agents (const arma::uword count) const
 
arma::mat initialise_normalised_agents (const arma::uword count) const
 

Additional Inherited Members

- Public Attributes inherited from pass::problem
const arma::vec lower_bounds
 
const arma::vec upper_bounds
 
const std::string name
 

Detailed Description

Rastrigin's function is based on the function of De Jong with the addition of cosine modulation to produce many local minima. Thus, the test function is highly multimodal. However, the location of the minima are regularly distributed. It is named after L. A. Rastrigin and was first published 1974 in "Systems of Extremal Control" as 2-dimensional problem and 1991 generalised for n dimensions by H. Mühlenbein, D. Schomisch and J. Born in "The Parallel Genetic Algorithm as Function Optimiser. Parallel Computing".

Its optimal parameter = (0, ..., 0) and optimal function value = 0.

\[ f(x_1 \cdots x_n) = 10n + \sum_{i=1}^n (x_i^2 -10cos(2\pi x_i)) \]

\[ -5.12 \leq x_i \leq 5.12 \]

\[ \text{minimum at }f(0, \cdots, 0) = 0 \]

Constructor & Destructor Documentation

◆ rastrigin_function()

pass::rastrigin_function::rastrigin_function ( const arma::uword  dimension)
explicit

Initialises a rastrigin function with dimension dimensions, lower bounds of -5.12 and upper bounds of 5.12.

Member Function Documentation

◆ evaluate()

double pass::rastrigin_function::evaluate ( const arma::vec &  agent) const
overridevirtual

Evaluates this problem at agent, which must match the dimensions of this problem.

Implements pass::problem.


The documentation for this class was generated from the following files: