GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Public Member Functions | List of all members
galib::benchmark::DeJongF5Function< GeneType > Class Template Reference

Implementation of De Jong's Function F5 (Shekel's Foxholes). More...

#include <DeJongF5Function.h>

Inheritance diagram for galib::benchmark::DeJongF5Function< GeneType >:
[legend]

Public Member Functions

 DeJongF5Function ()=default
 
 ~DeJongF5Function () override=default
 
double evaluate (const std::vector< GeneType > &phenotype) const override
 Evaluates the foxholes function.
 
std::size_t size () const override
 Returns the dimensionality of the optimization problem.
 
GeneType getLowerBound (std::size_t dimension) const override
 Gets the lower bound for a specific dimension.
 
GeneType getUpperBound (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.
 

Detailed Description

template<typename GeneType = double>
class galib::benchmark::DeJongF5Function< GeneType >

Implementation of De Jong's Function F5 (Shekel's Foxholes).

A highly multi-modal 2D function with 25 local minima (foxholes). Global minimum: f(-32, -32) ≈ 0.998.

Template Parameters
GeneTypeThe numeric type of the genes.

Definition at line 24 of file DeJongF5Function.h.

Constructor & Destructor Documentation

◆ DeJongF5Function()

template<typename GeneType = double>
galib::benchmark::DeJongF5Function< GeneType >::DeJongF5Function ( )
default

◆ ~DeJongF5Function()

template<typename GeneType = double>
galib::benchmark::DeJongF5Function< GeneType >::~DeJongF5Function ( )
overridedefault

Member Function Documentation

◆ evaluate()

template<typename GeneType = double>
double galib::benchmark::DeJongF5Function< GeneType >::evaluate ( const std::vector< GeneType > &  phenotype) const
inlineoverridevirtual

Evaluates the foxholes function.

Parameters
phenotypeMust have exactly 2 elements.
Returns
Fitness value.
Exceptions
std::invalid_argumentif phenotype size != 2.

Implements galib::FitnessFunction< GeneType >.

Definition at line 40 of file DeJongF5Function.h.

◆ getLowerBound()

template<typename GeneType = double>
GeneType galib::benchmark::DeJongF5Function< GeneType >::getLowerBound ( std::size_t  dimension) const
inlineoverridevirtual

Gets the lower bound for a specific dimension.

Parameters
dimensionIndex of the dimension.
Returns
Lower bound value.

Implements galib::FitnessFunction< GeneType >.

Definition at line 70 of file DeJongF5Function.h.

◆ getUpperBound()

template<typename GeneType = double>
GeneType galib::benchmark::DeJongF5Function< GeneType >::getUpperBound ( std::size_t  dimension) const
inlineoverridevirtual

Gets the upper bound for a specific dimension.

Parameters
dimensionIndex of the dimension.
Returns
Upper bound value.

Implements galib::FitnessFunction< GeneType >.

Definition at line 74 of file DeJongF5Function.h.

◆ size()

template<typename GeneType = double>
std::size_t galib::benchmark::DeJongF5Function< GeneType >::size ( ) const
inlineoverridevirtual

Returns the dimensionality of the optimization problem.

Returns
Number of dimensions.

Implements galib::FitnessFunction< GeneType >.

Definition at line 66 of file DeJongF5Function.h.


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