src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy

Module Contents

Classes

AUGMENTED_WCCI2020_Numpy_Problem

AUGMENTED_WCCI2020_Numpy_Problem

A Numpy-based implementation of base class for defining basic functions in AUGMENTED WCCI2020 Multitask Optimization(MTO) benchmark problems.

Sphere

Ackley

Griewank

Rastrigin

Rosenbrock

Weierstrass

Schwefel

API

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem(dim, shift, rotate, bias)[source]

Bases: src.environment.problem.basic_problem.Basic_Problem

AUGMENTED_WCCI2020_Numpy_Problem

A Numpy-based implementation of base class for defining basic functions in AUGMENTED WCCI2020 Multitask Optimization(MTO) benchmark problems.

Introduction

Augmented WCCI2020 proposes 127 multi-task benchmark problems to represent a wider range of multi-task optimization problems.

Original Paper

None

Official Implementation

None

License

None

Problem Suite Composition

The Augmented WCCI2020 problem suite contains a total of 127 benchmark problems, with each problem consisting of multiple different basic functions with unique transformations(shifts and rotations). The number of basic functions can be specified according to the user’s requirements. Defaults to 10. These 127 benchmark problems are composed based on all combinations of the seven basic functions as Shpere, Rosenbrock, Rastrigin, Ackley, Griewank, Weierstrass and Schwefel. For each benchmark problem, the basic functions in the correspondent combination are selected randomly and added with unique transformations(shifts and rotations) until the number of basic functions is reached.

Methods:

  • __init__(dim, shift, rotate, bias): Initializes the problem with the given parameters.

  • get_optimal(): Returns the optimal solution for the problem.

  • func(x): Abstract method to define the problem’s objective function. Must be implemented in subclasses.

  • decode(x): Decodes a solution from the normalized space [0, 1] to the problem’s actual search space.

  • sr_func(x, shift, rotate): Applies shift and rotation transformations to the input solution.

  • eval(x): Evaluates the solution(s) using the problem’s objective function. Supports both individual and population evaluations.

Raises:

  • NotImplementedError: Raised if the func method is not implemented in a subclass.

Initialization

Introduction

Initializes the class AUGMENTED_WCCI2020_Numpy_Problem.

Args:

  • dim (int): The dimensionality of the problem.

  • shift (numpy.ndarray): The shift vector applied to the problem.

  • rotate (numpy.ndarray): The rotation matrix applied to the problem.

  • bias (float): The bias value added to the problem.

Attributes:

  • T1 (float): Tracks the cumulative evaluation time in milliseconds.

  • dim (int): The dimensionality of the problem.

  • shift (numpy.ndarray): The shift vector applied to the problem.

  • rotate (numpy.ndarray): The rotation matrix applied to the problem.

  • bias (float): The bias value added to the problem.

  • lb (float): The lower bound of the problem’s search space.

  • ub (float): The upper bound of the problem’s search space.

  • FES (int): The number of function evaluations performed.

  • opt (numpy.ndarray): The optimal solution for the problem.

  • optimum (float): The optimal function value for the problem.

get_optimal()[source]

Introduction

Returns the optimal solution for the problem.

Returns:

  • numpy.ndarray: The optimal solution of the problem.

abstractmethod func(x)[source]

Introduction

Abstract method to define the problem’s objective function. Must be implemented in subclasses.

Args:

  • x (numpy.ndarray): The solution of the problem.

decode(x)[source]

Introduction

Decodes a solution from the normalized space [0, 1] to the problem’s actual search space.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The decoded solution of the problem.

sr_func(x, shift, rotate)[source]

Introduction

Applies shift and rotation transformations to the input solution.

Args:

  • x (numpy.ndarray): The solution of the problem.

  • shift (numpy.ndarray): The shift vector applied to the problem.

  • rotate (numpy.ndarray): The rotation matrix applied to the problem.

Returns:

  • numpy.ndarray: The solution being transformed by shift and rotatation.

eval(x)[source]

Introduction

A specific version of func() with adaptation to evaluate both individual and population in MTO.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Sphere(dim, shift, rotate, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

100

func(x)[source]

Introduction

The specific implementation of the Sphere’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “S” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Ackley(dim, shift, rotate, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

50

func(x)[source]

Introduction

The specific implementation of the Ackley’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “A” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Griewank(dim, shift=None, rotate=None, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

100

func(x)[source]

Introduction

The specific implementation of the Griewank’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “G” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Rastrigin(dim, shift=None, rotate=None, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

50

func(x)[source]

Introduction

The specific implementation of the Rastrigin’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “R” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Rosenbrock(dim, shift=None, rotate=None, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

50

func(x)[source]

Introduction

The specific implementation of the Rosenbrock’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “Ro” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Weierstrass(dim, shift, rotate, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

0.5

func(x)[source]

Introduction

The specific implementation of the Weierstrass’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “W” representing the object.

class src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.Schwefel(dim, shift=None, rotate=None, bias=0)[source]

Bases: src.environment.problem.MTO.AUGMENTED_WCCI2020.augmented_wcci2020_numpy.AUGMENTED_WCCI2020_Numpy_Problem

LB[source]

None

UB[source]

500

func(x)[source]

Introduction

The specific implementation of the Schwefel’s objective function.

Args:

  • x (numpy.ndarray): The solution of the problem.

Returns:

  • numpy.ndarray: The fitness value of the solution.

__str__()[source]

Returns a string representation of the object.

Returns:

  • str: The string “Sc” representing the object.