src.environment.problem.MOO.MOO_synthetic.wfg_numpy

Module Contents

Classes

WFG

Introduction

The WFG class represents a numpy-based family of multi-objective optimization problems known as the WFG (Walking Fish Group) test problems. These problems are widely used in the field of evolutionary multi-objective optimization to evaluate the performance of optimization algorithms. The WFG problems are characterized by their scalability, modularity, and ability to control problem difficulty through various parameters.

WFG1

Introduction

WFG1 is a standard multi-objective optimization test problem characterized by nonlinear and non-convex Pareto fronts.It is widely used to evaluate the performance of optimization algorithms. WFG1 includes multiple transformation stages such as bias and mixed shapes to increase problem complexity.

WFG2

Introduction

WFG2 is a multi-objective test problem featuring non-separable variables and disconnected Pareto fronts.It is designed to challenge optimization algorithms on handling variable dependencies and discontinuities.

WFG3

Introduction

WFG3 is a multi-objective test problem from the WFG suite that incorporates non-separable variable interactions and linear shape functions. It uses transformations from WFG1 and WFG2 and modifies the problem’s parameter matrix A to increase problem difficulty.

WFG4

Introduction

WFG4 is a multi-objective test problem from the WFG suite characterized by a multimodal transformation and concave shape functions. It introduces multimodality in the search space through a specialized transformation.

WFG5

Introduction

WFG5 is a multi-objective test problem from the WFG suite featuring deceptive transformations.It challenges optimization algorithms by introducing deceptiveness in the decision space.

WFG6

Introduction

WFG6 is a multi-objective test problem from the WFG suite characterized by non-separable reduction transformations that increase problem difficulty by linking variables in groups.

WFG7

Introduction

WFG7 is a multi-objective test problem from the WFG suite that introduces parameter-dependent transformations increasing problem complexity by coupling decision variables.

WFG8

Introduction

WFG8 is a complex multi-objective test problem from the WFG suite, featuring parameter-dependent transformations that increase problem difficulty and variable interactions.

WFG9

Introduction

WFG9 is a challenging multi-objective optimization test problem from the WFG suite,featuring multiple parameter-dependent transformations, deceptive and multi-modal shifts,and non-separable reductions.

Functions

crtup

Introduction

Generates a set of uniformly distributed reference points (weight vectors) for a given number of objectives. This function is typically used in multi-objective optimization algorithms such as NSGA-III and RVEA, where reference points are required to guide the selection process.

find_non_dominated_indices

Introduction

Find the indices of non-dominated solutions in a population.

A solution is said to be non-dominated if no other solution in the population dominates it. This function performs a pairwise comparison between all solutions.

convex

Introduction

Calculates the convex shape function used in multi-objective optimization.

mixed

Introduction

Calculates the mixed shape function.

linear

Introduction

Calculates the linear shape function.

s_linear

Introduction

Calculates the s_linear shape function, a linear shift transformation.

b_flat

Introduction

Calculates the b_flat transformation function.

b_poly

Introduction

Calculates the b_poly transformation, a polynomial bias function.

r_sum

Introduction

Calculates the weighted sum reduction function.

disc

Introduction

Calculates the discontinuous shape function.

_transformation_shift_linear

Introduction

Applies a linear shift transformation to the input value.

_transformation_shift_deceptive

Introduction

Applies a deceptive shift transformation to the input array.

_transformation_shift_multi_modal

Introduction

Applies a multi-modal shift transformation.

_transformation_bias_flat

Introduction

Applies a flat bias transformation to input array.

_transformation_bias_poly

Introduction

Applies a polynomial bias transformation to input array.

_transformation_param_dependent

Introduction

Applies a parameter-dependent transformation.

_transformation_param_deceptive

Introduction

Applies a parameter-dependent deceptive transformation.

_reduction_weighted_sum

Introduction

Applies a weighted sum reduction to the input matrix.

_reduction_weighted_sum_uniform

Introduction

Applies a uniform (equal-weight) sum reduction along axis 1.

_reduction_non_sep

Introduction

Applies a non-separable reduction transformation.

_shape_concave

Introduction

Computes concave Pareto front shape.

_shape_convex

Introduction

Computes convex Pareto front shape.

_shape_linear

Introduction

Computes linear Pareto front shape.

_shape_mixed

Introduction

Computes a mixed Pareto front shape with periodicity.

_shape_disconnected

Introduction

Computes a disconnected Pareto front shape.

validate_wfg2_wfg3

Introduction

Validates if the distance parameter l is valid for WFG2/WFG3.

correct_to_01

Introduction

Corrects numerical errors to ensure values lie within [0, 1].

API

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.crtup(n_obj, n_ref_points=1000)[source]

Introduction

Generates a set of uniformly distributed reference points (weight vectors) for a given number of objectives. This function is typically used in multi-objective optimization algorithms such as NSGA-III and RVEA, where reference points are required to guide the selection process.

Args:

  • n_obj (int): Number of objectives (i.e., the dimensionality of the reference points).

  • n_ref_points (int): Approximate number of desired reference points (default: 1000).

Returns:

  • W (np.ndarray): A 2D array of shape (n_comb, n_obj) representing the generated reference vectors.

  • n_comb (int): Actual number of generated reference vectors.

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.find_non_dominated_indices(Point)[source]

Introduction

Find the indices of non-dominated solutions in a population.

A solution is said to be non-dominated if no other solution in the population dominates it. This function performs a pairwise comparison between all solutions.

Args:

  • Point (np.ndarray): A 2D array of shape (n_points, n_objectives), where each row represents the objective values of a solution.

Returns:

  • non_dominated_indices (np.ndarray): Indices of the non-dominated solutions.

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.basic_problem.Basic_Problem

Introduction

The WFG class represents a numpy-based family of multi-objective optimization problems known as the WFG (Walking Fish Group) test problems. These problems are widely used in the field of evolutionary multi-objective optimization to evaluate the performance of optimization algorithms. The WFG problems are characterized by their scalability, modularity, and ability to control problem difficulty through various parameters.

Original paper

A review of multiobjective test problems and a scalable test problem toolkit.” IEEE Transactions on Evolutionary Computation 10.5 (2006): 477-506.

Official Implementation

pymoo

License

Apache-2.0

Problem Suite Composition

The WFG problem suite consists of a set of scalable multi-objective optimization problems. Each problem is defined by the number of decision variables (n_var), the number of objectives (n_obj), and two key parameters: k (position-related parameters) and l (distance-related parameters). These problems are designed to test the ability of optimization algorithms to handle complex Pareto fronts, including disconnected, degenerate, and mixed geometries.

Args:

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Position-related parameter. Defaults to 2 * (n_obj - 1) if not provided.

  • l (int, optional): Distance-related parameter. Defaults to n_var - k if not provided.

  • **kwargs: Additional keyword arguments.

Attributes:

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • lb (numpy.ndarray): Lower bounds for decision variables.

  • ub (numpy.ndarray): Upper bounds for decision variables.

  • vtype (type): Data type of decision variables (default is float).

  • S (numpy.ndarray): Scaling factors for objectives.

  • A (numpy.ndarray): Shift parameters for the Pareto front.

  • k (int): Position-related parameter.

  • l (int): Distance-related parameter.

Methods:

  • validate(l, k, n_obj): Validates the problem parameters to ensure they meet the constraints of the WFG problem suite.

  • _post(t, a): Transforms the decision variables using a post-processing function.

  • _calculate(x, s, h): Calculates the objective values based on the decision variables and scaling factors.

  • _rand_optimal_position(n): Generates random optimal positions for the decision variables.

  • _positional_to_optimal(K): Converts positional variables to optimal decision variables.

  • __str__(): Returns a string representation of the WFG problem instance.

Raises:

  • ValueError: Raised in the validate method if:

    • The number of objectives (n_obj) is less than 2.

    • The position parameter (k) is not divisible by the number of objectives minus one.

    • The position parameter (k) is less than 4.

    • The sum of the position and distance parameters (k + l) is less than the number of objectives (n_obj).

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

validate(l, k, n_obj)[source]

Introduction

Validate the WFG problem configuration parameters.

Args

  • l (int): Number of distance parameters.

  • k (int): Number of position parameters.

  • n_obj (int): Number of objectives.

Raises

  • ValueError: If constraints are violated.

_post(t, a)[source]

Introduction

Apply post-processing transformation to intermediate variable vector.

Args

  • t (np.ndarray): Input matrix of shape (n, m).

  • a (np.ndarray): Parameter vector.

Returns

  • np.ndarray: Transformed decision matrix of shape (n, m).

_calculate(x, s, h)[source]

Introduction

Compute the final objective values for each solution.

Args

  • x (np.ndarray): Transformed decision vectors.

  • s (np.ndarray): Scaling factors.

  • h (list of np.ndarray): Shape function values.

Returns

  • np.ndarray: Final objective values of shape (n_samples, n_obj).

_rand_optimal_position(n)[source]

Introduction

Generate random optimal positional vectors.

Args

  • n (int): Number of samples to generate.

Returns

  • np.ndarray: Random vectors of shape (n, k).

_positional_to_optimal(K)[source]

Introduction

Extend positional vector to a full decision vector using constant suffix.

Args

  • K (np.ndarray): Positional variable matrix of shape (n, k).

Returns

  • np.ndarray: Full decision variable matrix of shape (n, k + l).

__str__()[source]

Introduction

Return a string representation of the problem class.

Returns

  • str: A string describing the problem’s name, number of objectives, and variables.

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG1(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG1 is a standard multi-objective optimization test problem characterized by nonlinear and non-convex Pareto fronts.It is widely used to evaluate the performance of optimization algorithms. WFG1 includes multiple transformation stages such as bias and mixed shapes to increase problem complexity.

Attributes

  • Inherits all attributes from the WFG base class, including k, l, n_obj, n_var, ub, S, and A.

Methods

  • t1: Applies a shift linear transformation to the decision variables.

  • t2: Applies a flat bias transformation.

  • t3: Applies a polynomial bias transformation.

  • t4: Performs weighted sum reduction on variables.

  • func: Evaluates the WFG1 objective functions.

  • get_ref_set: Generates the true Pareto front reference points for benchmarking.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x, n, k)[source]

Introduction

Shift linear transformation applied to the variables from index k to n.

Args

  • x (np.ndarray): Input decision variables.

  • n (int): Total number of variables.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Transformed variables.

static t2(x, n, k)[source]

Introduction

Flat bias transformation applied to variables from index k to n.

Args

  • x (np.ndarray): Input variables.

  • n (int): Total number of variables.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Transformed variables.

static t3(x, n)[source]

Introduction

Polynomial bias transformation applied to the first n variables.

Args

  • x (np.ndarray): Input variables.

  • n (int): Number of variables to transform.

Returns

  • np.ndarray: Transformed variables.

static t4(x, m, n, k)[source]

Introduction

Weighted sum reduction of variables for aggregation.

Args

  • x (np.ndarray): Input variables.

  • m (int): Number of objectives.

  • n (int): Total number of variables.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Aggregated variables for objective evaluation.

func(x, *args, **kwargs)[source]

Introduction

Evaluates the WFG1 multi-objective functions for given decision variable vectors.

Args

  • x (np.ndarray): Decision variable input(s), shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values of shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates the true Pareto front reference set for the WFG1 problem.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG2(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG2 is a multi-objective test problem featuring non-separable variables and disconnected Pareto fronts.It is designed to challenge optimization algorithms on handling variable dependencies and discontinuities.

Attributes

  • Inherits from the WFG base class with parameters k, l, n_obj, n_var, ub, S, and A.

Methods

  • validate: Checks parameter validity specific to WFG2.

  • t2: Applies a non-separable transformation.

  • t3: Performs weighted sum uniform reduction.

  • func: Evaluates the WFG2 objectives.

  • get_ref_set: Generates non-dominated Pareto front reference points.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

validate(l, k, n_obj)[source]

Introduction

Validates parameters for WFG2, extending base WFG validation with additional constraints.

Args

  • l (int): Distance-related parameter.

  • k (int): Position-related parameter.

  • n_obj (int): Number of objectives.

Raises

  • ValueError: If validation fails.

static t2(x, n, k)[source]

Introduction

Non-separable transformation applied to certain variable pairs beyond position parameter k.

Args

  • x (np.ndarray): Input variables.

  • n (int): Total number of variables.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Transformed variables.

static t3(x, m, n, k)[source]

Introduction

Weighted sum uniform reduction of transformed variables for aggregation.

Args

  • x (np.ndarray): Input variables.

  • m (int): Number of objectives.

  • n (int): Total number of variables.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Aggregated variables.

func(x, *args, **kwargs)[source]

Introduction

Evaluates the WFG2 multi-objective functions for given decision variable vectors.

Args

  • x (np.ndarray): Decision variable input(s), shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values of shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates the true Pareto front reference set for the WFG2 problem.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG3(n_var, n_obj, k=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG3 is a multi-objective test problem from the WFG suite that incorporates non-separable variable interactions and linear shape functions. It uses transformations from WFG1 and WFG2 and modifies the problem’s parameter matrix A to increase problem difficulty.

Attributes

  • Inherits all attributes from the WFG base class, including k, l, n_obj, n_var, ub, S, and A.

  • Modifies the A matrix by setting all elements except the first to zero.

Methods

  • validate: Ensures that parameters comply with WFG2 and WFG3 constraints.

  • func: Computes the objective values for given decision variable vectors.

  • get_ref_set: Generates the true Pareto front reference points for benchmarking.

Initialization

Introduction

Initializes the WFG3 problem, adjusting the A matrix to meet WFG3 specifications.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Position-related parameter, defaults to None.

  • kwargs: Additional keyword arguments passed to the WFG base class.

validate(l, k, n_obj)[source]

Introduction

Validates the problem parameters, ensuring compliance with both WFG2 and WFG3 constraints.

Args

  • l (int): Distance-related parameter.

  • k (int): Position-related parameter.

  • n_obj (int): Number of objectives.

Raises

  • ValueError: If validation fails.

func(x, *args, **kwargs)[source]

Introduction

Evaluates the WFG3 multi-objective functions for given decision variables.

Args

  • x (np.ndarray): Decision variable input(s), shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values of shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates the true Pareto front reference set for the WFG3 problem.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG4(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG4 is a multi-objective test problem from the WFG suite characterized by a multimodal transformation and concave shape functions. It introduces multimodality in the search space through a specialized transformation.

Methods

  • t1: Applies a multimodal shift transformation to decision variables.

  • t2: Aggregates variables into groups and applies a weighted sum reduction.

  • func: Evaluates the objective functions for given decision variables.

  • get_ref_set: Generates a normalized true Pareto front reference set.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x)[source]

Introduction

Applies a multimodal shift transformation to the input vector.

Args

  • x (np.ndarray): Input decision variable matrix, shape (N, n_var).

Returns

  • np.ndarray: Transformed decision variables after multimodal shift.

static t2(x, m, k)[source]

Introduction

Performs uniform weighted sum reduction of decision variables grouped by objectives.

Args

  • x (np.ndarray): Input decision variable matrix, shape (N, n_var).

  • m (int): Number of objectives.

  • k (int): Position-related parameter.

Returns

  • np.ndarray: Reduced variable matrix, shape (N, m).

func(x, *args, **kwargs)[source]

Introduction

Evaluates the WFG4 multi-objective functions for given decision variables.

Args

  • x (np.ndarray): Decision variable input(s), shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values of shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates the normalized true Pareto front reference set for the WFG4 problem.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG5(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG5 is a multi-objective test problem from the WFG suite featuring deceptive transformations.It challenges optimization algorithms by introducing deceptiveness in the decision space.

Methods

  • t1: Applies a parameterized deceptive transformation to decision variables.

  • func: Evaluates the WFG5 objective functions.

  • get_ref_set: Generates a normalized true Pareto front reference set.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x)[source]

Introduction

Applies a parameterized deceptive transformation to input variables.

Args

  • x (np.ndarray): Input decision variable matrix, shape (N, n_var).

Returns

  • np.ndarray: Transformed variables after deceptive transformation.

func(x, *args, **kwargs)[source]

Introduction

Evaluates the WFG5 multi-objective functions for given decision variables.

Args

  • x (np.ndarray): Decision variable input(s), shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values of shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates the normalized true Pareto front reference set for the WFG5 problem.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG6(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG6 is a multi-objective test problem from the WFG suite characterized by non-separable reduction transformations that increase problem difficulty by linking variables in groups.

Methods

  • t2: Applies a non-separable reduction transformation on variable groups.

  • func: Evaluates the WFG6 objectives based on transformations and shape functions.

  • get_ref_set: Generates normalized Pareto front reference points for performance benchmarking.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t2(x, m, n, k)[source]

Introduction

Applies non-separable reduction transformation on groups of variables.

Args

  • x (np.ndarray): Input variable matrix, shape (N, n).

  • m (int): Number of objectives.

  • n (int): Number of variables.

  • k (int): Position parameter separating position-related variables.

Returns

  • np.ndarray: Reduced variable matrix, shape (N, m).

func(x, *args, **kwargs)[source]

Introduction

Computes the WFG6 multi-objective function values for given input variables.

Args

  • x (np.ndarray): Input decision variables, shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective function values, shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates a normalized set of reference points approximating the true Pareto front for WFG6.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points of shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG7(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG7 is a multi-objective test problem from the WFG suite that introduces parameter-dependent transformations increasing problem complexity by coupling decision variables.

Methods

  • t1: Applies a parameter-dependent transformation to the first k decision variables.

  • func: Computes the WFG7 objective values with defined transformations and shape functions.

  • get_ref_set: Generates normalized reference Pareto front points for benchmarking.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x, k)[source]

Introduction

Applies a parameter-dependent transformation on the first k variables based on the weighted sum of the remaining variables.

Args

  • x (np.ndarray): Input variable matrix, shape (N, n).

  • k (int): Number of variables to apply the transformation on.

Returns

  • np.ndarray: Transformed variable matrix of the same shape as input.

func(x, *args, **kwargs)[source]

Introduction

Calculates WFG7 multi-objective function values.

Args

  • x (np.ndarray): Input decision variables, shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Computed objectives, shape (N, n_obj).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates a normalized set of reference points approximating the true Pareto front for WFG7.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points, shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG8(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG8 is a complex multi-objective test problem from the WFG suite, featuring parameter-dependent transformations that increase problem difficulty and variable interactions.

Methods

  • t1: Applies a parameter-dependent transformation to variables from index k to n.

  • func: Computes the WFG8 objective values by applying transformations and shape functions.

  • _positional_to_optimal: Converts positional variables into optimal values using a specific formula.

  • get_ref_set: Generates normalized reference Pareto front points for benchmarking.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x, n, k)[source]

Introduction

Applies a parameter-dependent transformation on decision variables from index k to n-1, using the weighted sum of preceding variables as a parameter.

Args

  • x (np.ndarray): Input variable matrix, shape (N, n).

  • n (int): Total number of decision variables.

  • k (int): Number of position-related variables (first k variables not transformed).

Returns

  • np.ndarray: Transformed variable matrix of shape (N, n - k).

func(x, *args, **kwargs)[source]

Introduction

Calculates the WFG8 multi-objective function values.

Args

  • x (np.ndarray): Input decision variables, shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Computed objectives, shape (N, n_obj).

_positional_to_optimal(K)[source]

Introduction

Converts positional variables into optimal values based on a defined mathematical formula to enhance the problem’s difficulty.

Args

  • K (np.ndarray): Input matrix of positional variables, shape (N, k).

Returns

  • np.ndarray: Matrix transformed to optimal positional values, shape (N, n_var).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates a normalized set of reference points approximating the true Pareto front for WFG8.

Args

  • n_ref_points (int): Number of reference points to generate. Default is 1000.

Returns

  • np.ndarray: Reference Pareto front points, shape (N, n_obj).

class src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG9(n_var, n_obj, k=None, l=None, **kwargs)[source]

Bases: src.environment.problem.MOO.MOO_synthetic.wfg_numpy.WFG

Introduction

WFG9 is a challenging multi-objective optimization test problem from the WFG suite,featuring multiple parameter-dependent transformations, deceptive and multi-modal shifts,and non-separable reductions.

Methods

  • t1: Parameter-dependent transformation applied across variables except the last.

  • t2: Applies deceptive and multi-modal shift transformations.

  • t3: Performs non-separable reduction for objective calculation.

  • func: Computes the WFG9 objectives by applying transformations and shape functions.

  • _positional_to_optimal: Maps positional variables to optimal values using a backward calculation.

  • get_ref_set: Generates normalized reference Pareto front points for benchmarking.

Initialization

Introduction

Initialize WFG problem parameters, bounds, and validate configuration.

Args

  • n_var (int): Number of decision variables.

  • n_obj (int): Number of objectives.

  • k (int, optional): Number of position parameters.

  • l (int, optional): Number of distance parameters.

  • **kwargs: Additional keyword arguments.

static t1(x, n)[source]

Introduction

Applies a parameter-dependent transformation on the first n-1 variables, where each variable depends on a weighted sum of subsequent variables.

Args

  • x (np.ndarray): Input variable matrix of shape (N, n).

  • n (int): Total number of decision variables.

Returns

  • np.ndarray: Transformed variable matrix of shape (N, n-1).

static t2(x, n, k)[source]

Introduction

Applies shift transformations: deceptive shift on the first k variables, and multi-modal shift on the remaining variables.

Args

  • x (np.ndarray): Input variable matrix, shape (N, n).

  • n (int): Number of variables.

  • k (int): Number of position-related variables.

Returns

  • np.ndarray: Transformed variable matrix, shape (N, n).

static t3(x, m, n, k)[source]

Introduction

Performs non-separable reduction on grouped variables to produce m objective-related variables.

Args

  • x (np.ndarray): Input variable matrix, shape (N, n).

  • m (int): Number of objectives.

  • n (int): Number of variables.

  • k (int): Number of position-related variables.

Returns

  • np.ndarray: Reduced variable matrix, shape (N, m).

func(x, *args, **kwargs)[source]

Introduction

Computes the WFG9 multi-objective function values by sequentially applying transformations t1, t2, and t3, then shape functions and scaling.

Args

  • x (np.ndarray): Decision variable input, shape (N, n_var) or (n_var,).

Returns

  • np.ndarray: Objective values, shape (N, n_obj).

_positional_to_optimal(K)[source]

Introduction

Maps positional variables into optimal values using a backward calculation involving power functions and sums over subsequent variables.

Args

  • K (np.ndarray): Positional variable matrix, shape (N, k).

Returns

  • np.ndarray: Transformed variables matrix, shape (N, n_var).

get_ref_set(n_ref_points=1000)[source]

Introduction

Generates normalized reference points uniformly distributed on the Pareto front for benchmarking WFG9.

Args

  • n_ref_points (int): Number of reference points to generate, default 1000.

Returns

  • np.ndarray: Reference objective values matrix, shape (N, n_obj).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.convex(x)[source]

Introduction

Calculates the convex shape function used in multi-objective optimization.

Args

  • x (np.ndarray): Input array with shape (N, M).

Returns

  • np.ndarray: Output array with shape (N, M).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.mixed(x)[source]

Introduction

Calculates the mixed shape function.

Args

  • x (np.ndarray): Input array with shape (N, M).

Returns

  • np.ndarray: Output array with shape (N, 1).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.linear(x)[source]

Introduction

Calculates the linear shape function.

Args

  • x (np.ndarray): Input array with shape (N, M).

Returns

  • np.ndarray: Output array with shape (N, M).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.s_linear(x, A)[source]

Introduction

Calculates the s_linear shape function, a linear shift transformation.

Args

  • x (np.ndarray): Input array.

  • A (float): Shift parameter.

Returns

  • np.ndarray: Transformed array.

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.b_flat(x, A, B, C)[source]

Introduction

Calculates the b_flat transformation function.

Args

  • x (np.ndarray): Input array.

  • A (float): Parameter A controlling flatness.

  • B (float): Parameter B defining interval start.

  • C (float): Parameter C defining interval end.

Returns

  • np.ndarray: Transformed array, rounded to 6 decimals.

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.b_poly(x, a)[source]

Introduction

Calculates the b_poly transformation, a polynomial bias function.

Args

  • x (np.ndarray): Input array.

  • a (float): Exponent parameter.

Returns

  • np.ndarray: Transformed array.

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.r_sum(x, w)[source]

Introduction

Calculates the weighted sum reduction function.

Args

  • x (np.ndarray): Input array with shape (N, M).

  • w (np.ndarray): Weight vector with length M.

Returns

  • np.ndarray: Reduced values of shape (N,).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.disc(x)[source]

Introduction

Calculates the discontinuous shape function.

Args

  • x (np.ndarray): Input array with shape (N, M).

Returns

  • np.ndarray: Output array with shape (N, 1).

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_shift_linear(value, shift=0.35)[source]

Introduction

Applies a linear shift transformation to the input value.

Args

  • value (np.ndarray): Input array.

  • shift (float): Shift parameter (default 0.35).

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_shift_deceptive(y, A=0.35, B=0.005, C=0.05)[source]

Introduction

Applies a deceptive shift transformation to the input array.

Args

  • y (np.ndarray): Input array.

  • A (float): Parameter controlling the deceptive region center (default 0.35).

  • B (float): Parameter controlling the deceptive region width (default 0.005).

  • C (float): Parameter controlling the depth of deception (default 0.05).

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_shift_multi_modal(y, A, B, C)[source]

Introduction

Applies a multi-modal shift transformation.

Args

  • y (np.ndarray): Input array.

  • A (float): Controls modality amplitude.

  • B (float): Controls modality frequency.

  • C (float): Controls modality position.

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_bias_flat(y, a, b, c)[source]

Introduction

Applies a flat bias transformation to input array.

Args

  • y (np.ndarray): Input array.

  • a (float): Bias parameter.

  • b (float): Left boundary of flat region.

  • c (float): Right boundary of flat region.

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_bias_poly(y, alpha)[source]

Introduction

Applies a polynomial bias transformation to input array.

Args

  • y (np.ndarray): Input array.

  • alpha (float): Exponent parameter controlling bias.

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_param_dependent(y, y_deg, A=0.98 / 49.98, B=0.02, C=50.0)[source]

Introduction

Applies a parameter-dependent transformation.

Args

  • y (np.ndarray): Input array.

  • y_deg (np.ndarray): Parameter dependent variable.

  • A (float): Parameter A (default 0.98 / 49.98).

  • B (float): Parameter B (default 0.02).

  • C (float): Parameter C (default 50.0).

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._transformation_param_deceptive(y, A=0.35, B=0.001, C=0.05)[source]

Introduction

Applies a parameter-dependent deceptive transformation.

Args

  • y (np.ndarray): Input array.

  • A (float): Parameter controlling deceptive region center (default 0.35).

  • B (float): Parameter controlling deceptive region width (default 0.001).

  • C (float): Parameter controlling deception depth (default 0.05).

Returns

  • np.ndarray: Transformed array corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._reduction_weighted_sum(y, w)[source]

Introduction

Applies a weighted sum reduction to the input matrix.

Args

  • y (np.ndarray): Input matrix of shape (n_samples, n_features).

  • w (np.ndarray): Weight vector of shape (n_features,).

Returns

  • np.ndarray: Reduced values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._reduction_weighted_sum_uniform(y)[source]

Introduction

Applies a uniform (equal-weight) sum reduction along axis 1.

Args

  • y (np.ndarray): Input matrix of shape (n_samples, n_features).

Returns

  • np.ndarray: Reduced values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._reduction_non_sep(y, A)[source]

Introduction

Applies a non-separable reduction transformation.

Args

  • y (np.ndarray): Input matrix of shape (n_samples, n_features).

  • A (int): Non-separability parameter.

Returns

  • np.ndarray: Reduced values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._shape_concave(x, m)[source]

Introduction

Computes concave Pareto front shape.

Args

  • x (np.ndarray): Input decision variables (n_samples, n_features).

  • m (int): Objective index (1-based).

Returns

  • np.ndarray: Shape values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._shape_convex(x, m)[source]

Introduction

Computes convex Pareto front shape.

Args

  • x (np.ndarray): Input decision variables (n_samples, n_features).

  • m (int): Objective index (1-based).

Returns

  • np.ndarray: Shape values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._shape_linear(x, m)[source]

Introduction

Computes linear Pareto front shape.

Args

  • x (np.ndarray): Input decision variables (n_samples, n_features).

  • m (int): Objective index (1-based).

Returns

  • np.ndarray: Shape values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._shape_mixed(x, A=5.0, alpha=1.0)[source]

Introduction

Computes a mixed Pareto front shape with periodicity.

Args

  • x (np.ndarray): Input array.

  • A (float): Frequency factor (default 5.0).

  • alpha (float): Exponent for scaling (default 1.0).

Returns

  • np.ndarray: Shape values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy._shape_disconnected(x, alpha=1.0, beta=1.0, A=5.0)[source]

Introduction

Computes a disconnected Pareto front shape.

Args

  • x (np.ndarray): Input array.

  • alpha (float): Exponent for x (default 1.0).

  • beta (float): Exponent for cosine input (default 1.0).

  • A (float): Frequency of cosine (default 5.0).

Returns

  • np.ndarray: Shape values corrected to [0, 1].

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.validate_wfg2_wfg3(l)[source]

Introduction

Validates if the distance parameter l is valid for WFG2/WFG3.

Args

  • l (int): Distance parameter.

Raises

  • ValueError: If l is not divisible by 2.

src.environment.problem.MOO.MOO_synthetic.wfg_numpy.correct_to_01(X, epsilon=1e-10)[source]

Introduction

Corrects numerical errors to ensure values lie within [0, 1].

Args

  • X (np.ndarray): Input array.

  • epsilon (float): Tolerance for numerical error (default 1e-10).

Returns

  • np.ndarray: Corrected array.