cec2022#
Classes#
CompositionFunction1#
-
class CompositionFunction1 : public ioh::problem::CEC2022Problem<CompositionFunction1>#
Class representing the first composition function in the CEC benchmark suite.
Public Functions
-
inline CompositionFunction1(const int instance, const int n_variables)#
Constructs a CEC_CompositionFunction1 instance.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables in the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the given input vector.
- Parameters:
x – The input vector.
- Returns:
The objective function value.
-
inline CompositionFunction1(const int instance, const int n_variables)#
CompositionFunction2#
-
class CompositionFunction2 : public ioh::problem::CEC2022Problem<CompositionFunction2>#
Class representing the second composition function in the CEC benchmark suite.
Public Functions
-
inline CompositionFunction2(const int instance, const int n_variables)#
Constructs a CEC_CompositionFunction2 instance.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables in the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the given input vector.
- Parameters:
x – The input vector.
- Returns:
The objective function value.
-
inline CompositionFunction2(const int instance, const int n_variables)#
CompositionFunction3#
-
class CompositionFunction3 : public ioh::problem::CEC2022Problem<CompositionFunction3>#
Class representing the third composition function in the CEC benchmark suite.
Public Functions
-
inline CompositionFunction3(const int instance, const int n_variables)#
Constructs a CEC_CompositionFunction3 instance.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables in the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the given input vector.
- Parameters:
x – The input vector.
- Returns:
The objective function value.
-
inline CompositionFunction3(const int instance, const int n_variables)#
CompositionFunction4#
-
class CompositionFunction4 : public ioh::problem::CEC2022Problem<CompositionFunction4>#
Class representing the fourth composition function in the CEC benchmark suite.
Public Functions
-
inline CompositionFunction4(const int instance, const int n_variables)#
Constructs a CEC_CompositionFunction4 instance.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables in the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the given input vector.
- Parameters:
x – The input vector.
- Returns:
The objective function value.
-
inline CompositionFunction4(const int instance, const int n_variables)#
HybridFunction1#
-
class HybridFunction1 : public ioh::problem::CEC2022Problem<HybridFunction1>#
A class representing the HybridFunction1 problem, derived from the CECProblem class.
This class represents a specific optimization problem which is a hybrid of several other functions. It overrides the evaluate and transform_variables methods to provide the specific implementation for this problem.
Public Functions
-
inline HybridFunction1(const int instance, const int n_variables)#
Constructor for the HybridFunction1 class.
Initializes a new instance of the HybridFunction1 class, setting up the problem with the specified instance and number of variables.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables for the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Computes the hf02 function value for the input vector.
The hf02 function is a hybrid function that combines several benchmark functions to create a complex, multimodal landscape. It is used to evaluate the performance of optimization algorithms in navigating complex, high-dimensional spaces.
- Parameters:
x – Input vector containing the coordinates in the domain space.
- Returns:
The function value at the point specified by the input vector.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Transforms the input variables according to the problem’s specific transformations.
This method applies several transformations to the input variables, including scaling, rotation, and permutation. It then divides the transformed variables into several groups and applies additional transformations to each group.
- Parameters:
x – A vector of input variables.
- Returns:
A vector of transformed variables, ready to be evaluated by the objective function.
-
inline HybridFunction1(const int instance, const int n_variables)#
HybridFunction2#
-
class HybridFunction2 : public ioh::problem::CEC2022Problem<HybridFunction2>#
HybridFunction2 class that inherits from CECProblem.
Public Functions
-
inline HybridFunction2(const int instance, const int n_variables)#
Constructor of the HybridFunction2 class.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Computes the hf06 function value for the input vector.
The hf06 function is another hybrid function that integrates several benchmark functions to create a challenging optimization landscape characterized by multiple local minima and a global minimum. It is utilized to test the robustness and efficiency of optimization algorithms.
- Parameters:
prepared_y – Input vector containing the coordinates in the domain space.
- Returns:
The function value at the point specified by the input vector.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Transforms the input variables.
- Parameters:
x – The input variables.
- Returns:
The transformed variables.
-
inline HybridFunction2(const int instance, const int n_variables)#
HybridFunction3#
-
class HybridFunction3 : public ioh::problem::CEC2022Problem<HybridFunction3>#
HybridFunction3 class that inherits from CECProblem.
Public Functions
-
inline HybridFunction3(const int instance, const int n_variables)#
Constructor of the HybridFunction3 class.
- Parameters:
instance – The instance number of the problem.
n_variables – The number of variables.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Computes the hf06 function value for the input vector.
The hf06 function is another hybrid function that integrates several benchmark functions to create a challenging optimization landscape characterized by multiple local minima and a global minimum. It is utilized to test the robustness and efficiency of optimization algorithms.
- Parameters:
x – Input vector containing the coordinates in the domain space.
- Returns:
The function value at the point specified by the input vector.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Transforms the input variables.
- Parameters:
x – The input variables.
- Returns:
The transformed variables.
-
inline HybridFunction3(const int instance, const int n_variables)#
Levy#
-
class Levy : public ioh::problem::CEC2022Problem<Levy>#
The Levy class represents the Levy optimization problem, inheriting necessary functionalities from the CECProblem template class.
Public Functions
Rastrigin#
-
class Rastrigin : public ioh::problem::CEC2022Problem<Rastrigin>#
The Rastrigin class represents the Rastrigin optimization problem, inheriting necessary functionalities from the CECProblem template class.
Public Functions
Rosenbrock#
-
class Rosenbrock : public ioh::problem::CEC2022Problem<Rosenbrock>#
The Rosenbrock class encapsulates the Rosenbrock optimization problem, inheriting functionalities from the template class CECProblem.
Public Functions
-
inline Rosenbrock(const int instance, const int n_variables)#
Constructs a Rosenbrock problem instance with specified number of variables and instance identifier.
- Parameters:
instance – An integer representing the specific problem instance number.
n_variables – An integer representing the number of variables for this problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the Rosenbrock problem.
The Rosenbrock function is computed at the given point in the search space and returned.
- Parameters:
x – A vector representing a point in the search space.
- Returns:
The value of the Rosenbrock function at point x.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Transforms the variables using specific scale and rotate operations as defined for the Rosenbrock problem.
This function performs necessary transformations on the input variables to suit the problem’s specific requirements.
- Parameters:
x – A vector of input variables.
- Returns:
A vector of transformed variables which are more suited for evaluation in the Rosenbrock problem context.
-
inline Rosenbrock(const int instance, const int n_variables)#
SchafferF7#
-
class SchafferF7 : public ioh::problem::CEC2022Problem<SchafferF7>#
The SchafferF7 class represents the Expanded Schaffer F7 optimization problem, inheriting necessary functionalities from the CECProblem template class.
Public Functions
-
inline SchafferF7(const int instance, const int n_variables)#
Constructor initializing the Schaffer F7 problem with given instance number and variable count.
- Parameters:
instance – Instance number for the problem.
n_variables – Number of variables for the problem.
Protected Functions
-
inline double evaluate(const std::vector<double> &y) override#
Computes the Schaffer F7 objective function value at the given point.
- Parameters:
y – A vector representing a point in the search space.
- Returns:
The objective function value at the input point.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Performs a defined transformation on the input variables to make them suitable for the Expanded Schaffer F7 problem evaluation.
- Parameters:
x – A vector of input variables.
- Returns:
A vector containing the transformed variables.
-
inline SchafferF7(const int instance, const int n_variables)#
Zakharov#
-
class Zakharov : public ioh::problem::CEC2022Problem<Zakharov>#
Zakharov class inherits from the template CECProblem with Zakharov as the template parameter.
This class encapsulates the Zakharov problem for the CEC benchmark suite.
Public Functions
Protected Functions
-
inline double evaluate(const std::vector<double> &x) override#
Evaluates the objective function for the Zakharov problem.
- Parameters:
x – A vector representing a point in the search space.
- Returns:
The objective function value at point x.
-
inline std::vector<double> transform_variables(std::vector<double> x) override#
Transforms the variables using scale and rotate operations.
It modifies the input variables to suit the problem’s specific transformation requirements.
- Parameters:
x – A vector of input variables.
- Returns:
A transformed vector of variables which are suitable for the Zakharov problem.
-
inline double evaluate(const std::vector<double> &x) override#
Functions#
calculate_composite#
-
inline double ioh::problem::cec2022::calculate_composite(const std::vector<double> &x, const std::vector<std::vector<double>> &os, const std::vector<std::vector<std::vector<double>>> <, const std::vector<double> &deltas, const std::vector<double> &biases, const std::vector<double> &sh_rates, const std::vector<bool> &s_flags, const std::vector<bool> &r_flags, const std::vector<double> &f_scale, const std::vector<RealFunction> &functions)#
The calculate_composite function is a helper function used in the computation of composite functions in optimization problems.
It calculates the weighted sum of several function values, which is a common approach in creating hybrid functions to test optimization algorithms.
- Parameters:
x – Input vector containing the coordinates in the domain space
os – Transformation vectors used in the function computation.
lt – Transformation matrices
deltas –
biases –
sh_rates –
s_flags –
r_flags –
f_scale –
functions – the list of functions
- Returns:
The weighted sum of function values.
calculate_hybrid#
-
inline double ioh::problem::cec2022::calculate_hybrid(const std::vector<double> &x, const std::vector<double> &fractions, const std::vector<double> &scales, const std::vector<RealFunction> &functions)#
Calculate Hybrid function, were each of the functions is evaluated on a portion of the search variables, defined in fractions.
- Parameters:
x – The search variables
fractions – the proportion of variables to execute each function on
scales – scaling applied to each function
functions – the list of functions
- Returns:
the fitness