Problems

Package related to problem description and design of experiment.

Classes summary

Problems.Problem.Problem(n_dvar, n_obj)

Abstract class for real-valued optimization problems.

Problems.Box_Constrained.Box_Constrained(...)

Abstract class for real-valued box-constrained optimization problems.

Problems.Single_Objective.Single_Objective(n_dvar)

Abstract class for artificial single-objective real-valued box-constrained optimization problems.

Problems.Multi_Objective.Multi_Objective(...)

Abstract class for artificial multi-objective real-valued box-constrained optimization problems.

Problems.Ackley.Ackley(n_dvar)

Class for the single-objective Ackley problem.

Problems.Xiong.Xiong()

Class for 1D single-objective Xiong problem.

Problems.Schwefel.Schwefel(n_dvar)

Class for the single-objective Schwefel problem.

Problems.Rastrigin.Rastrigin(n_dvar)

Class for the single-objective Rastrigin problem.

Problems.Rosenbrock.Rosenbrock(n_dvar)

Class for the single-objective Rosenbrock problem.

Problems.CEC2013.CEC2013(f_id, n_dvar)

Class for single-objective problems from the CEC2013.

Problems.CEC2014.CEC2014(f_id, n_dvar)

Class for single-objective problems from the CEC2014.

Problems.DTLZ.DTLZ(f_id, n_dvar, n_obj)

Class for multi-objective problems from the DTLZ test suite.

Problems.ZDT.ZDT(f_id, n_dvar)

Class for bi-objective problems from the ZDT test suite.

Problems.DoE.DoE(pb)

Class for Design of Experiments.

Abstract classes

Problem

class Problems.Problem.Problem(n_dvar, n_obj)

Bases: ABC

Abstract class for real-valued optimization problems.

Parameters:
  • n_dvar (positive int, not zero) – number of decision variables

  • n_obj (positive int, not zero) – number of objectives

Box-constrained

class Problems.Box_Constrained.Box_Constrained(n_dvar, n_obj)

Bases: Problem

Abstract class for real-valued box-constrained optimization problems.

Single_Objective

class Problems.Single_Objective.Single_Objective(n_dvar)

Bases: Box_Constrained

Abstract class for artificial single-objective real-valued box-constrained optimization problems.

Parameters:

n_dvar (positive int, not zero) – number of decision variables

Multi_Objective

class Problems.Multi_Objective.Multi_Objective(n_dvar, n_obj)

Bases: Box_Constrained

Abstract class for artificial multi-objective real-valued box-constrained optimization problems.

Parameters:

n_dvar (positive int, not zero) – number of decision variables

Single-Objective Problems

Ackley

class Problems.Ackley.Ackley(n_dvar)

Bases: Single_Objective

Class for the single-objective Ackley problem.

Parameters:

n_dvar (positive int, not zero) – number of decision variable

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 1D or 2-D Ackley objective function.

Xiong

class Problems.Xiong.Xiong

Bases: Single_Objective

Class for 1D single-objective Xiong problem.

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 1D Xiong objective function.

Schwefel

class Problems.Schwefel.Schwefel(n_dvar)

Bases: Single_Objective

Class for the single-objective Schwefel problem.

Parameters:

n_dvar (positive int, not zero) – number of decision variables

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 1D or 2D Schwefel objective function.

Rastrigin

class Problems.Rastrigin.Rastrigin(n_dvar)

Bases: Single_Objective

Class for the single-objective Rastrigin problem.

Parameters:

n_dvar (positive int, not zero) – number of decision variable

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 1D or 2D Rastrigin objective function.

Rosenbrock

class Problems.Rosenbrock.Rosenbrock(n_dvar)

Bases: Single_Objective

Class for the single-objective Rosenbrock problem.

Parameters:

n_dvar (positive int, >1) – number of decision variable

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 2D Rosenbrock objective function.

CEC2013

class Problems.CEC2013.CEC2013(f_id, n_dvar)

Bases: Single_Objective

Class for single-objective problems from the CEC2013.

Parameters:
  • f_id (int in {1,...,28}) – problem’s identifier into the pygmo library

  • n_dvar (int in {2,5,20,30,40,50,60,70,80,90,100}) – number of decision variables

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 2D CEC2013 considered problem’s objective function.

CEC2014

class Problems.CEC2014.CEC2014(f_id, n_dvar)

Bases: Single_Objective

Class for single-objective problems from the CEC2014.

Parameters:
  • f_id (int in {1,...,30}) – problem’s identifier into the pygmo library

  • n_dvar (int in {2,10,20,30,50,100}) – number of decision variable

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

plot()

Plot the 2D CEC2014 considered problem’s objective function.

Multi-Objective Problems

DTLZ

class Problems.DTLZ.DTLZ(f_id, n_dvar, n_obj)

Bases: Multi_Objective

Class for multi-objective problems from the DTLZ test suite.

Parameters:
  • f_id (int in {1,...,7}) – problem’s identifier into the pygmo library

  • n_dvar (positive int, not zero, strictly greater than n_obj) – number of decision variables

  • n_obj (positive int, strictly greater than 1) – number of objectives

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

ZDT

class Problems.ZDT.ZDT(f_id, n_dvar)

Bases: Multi_Objective

Class for bi-objective problems from the ZDT test suite.

Parameters:
  • f_id (int in {1,2,3,4,6}) – problem’s identifier into the pygmo library

  • n_dvar (positive int, strictly greater than 1) – number of decision variables

perform_real_evaluation(candidates)

Objective function.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

objective values

Return type:

np.ndarray

get_bounds()

Returns search space bounds.

Returns:

search space bounds

Return type:

np.ndarray

is_feasible(candidates)

Check feasibility of candidates.

Parameters:

candidates (np.ndarray) – candidate decision vectors

Returns:

boolean indicating whether candidates are feasible

Return type:

bool

Design of Experiments

class Problems.DoE.DoE(pb)

Bases: object

Class for Design of Experiments.

Parameters:

pb (Box_Constrained) – related optimization problem

random_uniform_sampling(nb_samples)

Returns samples generated by random uniform sampling over the search space.

Parameters:

nb_samples (positive int, not zero) – number of samples to generate

Returns:

samples

Return type:

np.ndarray

latin_hypercube_sampling(nb_samples)

Returns samples generated by latin hypercube sampling over the search space.

Parameters:

nb_samples (positive int, not zero) – number of samples to generate

Returns:

samples

Return type:

np.ndarray