cec2022

Classes

CompositionFunction1

class CompositionFunction1 : public ioh::problem::CEC2022

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.

Public Static Attributes

static constexpr int registry_id = 1009

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022CompositionFunction1"

The name in the registry, also used by the constructor.

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.

CompositionFunction2

class CompositionFunction2 : public ioh::problem::CEC2022

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.

Public Static Attributes

static constexpr int registry_id = 1010

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022CompositionFunction2"

The name in the registry, also used by the constructor.

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.

CompositionFunction3

class CompositionFunction3 : public ioh::problem::CEC2022

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.

Public Static Attributes

static constexpr int registry_id = 1011

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022CompositionFunction3"

The name in the registry, also used by the constructor.

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.

CompositionFunction4

class CompositionFunction4 : public ioh::problem::CEC2022

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.

Public Static Attributes

static constexpr int registry_id = 1012

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022CompositionFunction4"

The name in the registry, also used by the constructor.

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.

HybridFunction1

class HybridFunction1 : public ioh::problem::CEC2022

The HybridFunction1 problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

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.

Public Static Attributes

static constexpr int registry_id = 1006

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022HybridFunction1"

The name in the registry, also used by the constructor.

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.

HybridFunction2

class HybridFunction2 : public ioh::problem::CEC2022

The HybridFunction2 problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

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.

Public Static Attributes

static constexpr int registry_id = 1007

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022HybridFunction2"

The name in the registry, also used by the constructor.

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.

HybridFunction3

class HybridFunction3 : public ioh::problem::CEC2022

The HybridFunction3 problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

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.

Public Static Attributes

static constexpr int registry_id = 1008

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022HybridFunction3"

The name in the registry, also used by the constructor.

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.

Levy

class Levy : public ioh::problem::CEC2022

The Levy problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

Public Functions

inline Levy(const int instance, const int n_variables)

Constructor initializing the Levy problem with given instance number and variable count.

Parameters:
  • instance – Instance number for the problem.

  • n_variables – Number of variables for the problem.

Public Static Attributes

static constexpr int registry_id = 1005

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022Levy"

The name in the registry, also used by the constructor.

Protected Functions

inline double evaluate(const std::vector<double> &z) override

Computes the Levy objective function value at the given point.

Parameters:

z – 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 Levy problem evaluation.

Parameters:

x – A vector of input variables.

Returns:

A vector containing the transformed variables.

Rastrigin

class Rastrigin : public ioh::problem::CEC2022

The Rastrigin problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

Public Functions

inline Rastrigin(const int instance, const int n_variables)

Constructor initializing the Rastrigin problem with given instance number and variable count.

Parameters:
  • instance – Instance number for the problem.

  • n_variables – Number of variables for the problem.

Public Static Attributes

static constexpr int registry_id = 1004

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022Rastrigin"

The name in the registry, also used by the constructor.

Protected Functions

inline double evaluate(const std::vector<double> &z) override

Computes the Rastrigin objective function value at the given point.

Parameters:

z – 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 Rastrigin problem evaluation.

Parameters:

x – A vector of input variables.

Returns:

A vector containing the transformed variables.

Rosenbrock

class Rosenbrock : public ioh::problem::CEC2022

The Rosenbrock problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

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.

Public Static Attributes

static constexpr int registry_id = 1002

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022Rosenbrock"

The name in the registry, also used by the constructor.

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.

SchafferF7

class SchafferF7 : public ioh::problem::CEC2022

The Expanded Schaffer F7 problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry).

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.

Public Static Attributes

static constexpr int registry_id = 1003

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022SchafferF7"

The name in the registry, also used by the constructor.

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.

Zakharov

class Zakharov : public ioh::problem::CEC2022

The Zakharov problem of the CEC2022 suite.

Derives from CEC2022; its registry id and name are registry_id and registry_name, and the compiled library registers it (src/registry). This class encapsulates the Zakharov problem for the CEC benchmark suite.

Public Functions

inline Zakharov(const int instance, const int n_variables)

Constructs a Zakharov problem instance.

Parameters:
  • instance – An integer representing the problem instance number.

  • n_variables – An integer representing the number of variables for the problem.

Public Static Attributes

static constexpr int registry_id = 1001

The id in the registry, also used by the constructor.

static constexpr const char *registry_name = "CEC2022Zakharov"

The name in the registry, also used by the constructor.

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.

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>>> &lt, 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