1#ifndef FITNESS_FUNCTION_H
2#define FITNESS_FUNCTION_H
20 template <
typename GeneType =
double>
33 virtual double evaluate(
const std::vector<GeneType>& phenotype)
const = 0;
39 [[nodiscard]]
virtual std::size_t
size()
const = 0;
50 [[nodiscard]]
virtual std::string
name()
const {
return ""; }
Abstract base class for objective functions to be minimized.
virtual GeneType getLowerBound(std::size_t dimension) const =0
Gets the lower bound for a specific dimension.
GeneType getLowerBound() const
Convenience method to get the lower bound of the first dimension.
virtual std::string name() const
Short identifier used to select a GPU evaluation kernel.
GeneType getUpperBound() const
Convenience method to get the upper bound of the first dimension.
virtual ~FitnessFunction()=default
virtual GeneType getUpperBound(std::size_t dimension) const =0
Gets the upper bound for a specific dimension.
virtual std::size_t size() const =0
Returns the dimensionality of the optimization problem.
virtual double evaluate(const std::vector< GeneType > &phenotype) const =0
Evaluates the fitness of a candidate solution.