smt_optim.benchmarks package#

Subpackages#

Submodules#

smt_optim.benchmarks.base module#

class BenchmarkProblem[source]#

Bases: ABC

bounds: ndarray = None#
constraints: list = None#
name: str = None#
num_cstr: int = None#
num_dim: int | str = None#
num_fidelity: int = None#
num_obj: int = None#
objective: Callable | list[Callable] = None#
set_dim(dim)[source]#
tags: list = None#

smt_optim.benchmarks.registry module#

get_problem(name: str) BenchmarkProblem[source]#

Retrieves a single BenchmarkProblem object by its unique name.

Parameters:

name (str) – The name of the problem to retrieve.

Returns:

result – The retrieved BenchmarkProblem object, or None if no matching problem is found.

Return type:

BenchmarkProblem or None

list_problems(n: list[int] = None, num_obj: list[int] = [1, 1], num_dim: list[int] = None, num_cstr: list[int] = None, num_fidelity: list[int] = None, tags: list[str] = None) list[BenchmarkProblem][source]#

Retrieves all benchmark problems matching the specified filtering criteria.

Parameters:
  • n (list[int], optional) –

    Deprecated alias for num_dim. A two-element list [min_num_dim, max_num_dim] specifying the inclusive range for the number of design variables.

    Warning

    n is deprecated and will be removed in a future release. Use num_dim instead.

  • num_obj (list[int], optional) – A two-element list [min_num_obj, max_num_obj] specifying the inclusive range for the number of objectives. If None, no filtering is applied on the number of objectives.

  • num_dim (list[int], optional) – A two-element list [min_num_dim, max_num_dim] specifying the inclusive range for the number of design variables. If None, no filtering is applied on the number of dimensions.

  • num_cstr (list[int], optional) – A two-element list [min_num_cstr, max_num_cstr] specifying the inclusive range for the number of constraints. If None, no filtering is applied on the number of constraints.

  • num_fidelity (list[int], optional) – A two-element list [min_num_fidelity, max_num_fidelity] specifying the inclusive range for the number of fidelity levels. If None, no filtering is applied on the number of fidelities.

  • tags (list[str], optional) – A list of tags used to filter benchmark problems. A problem is returned if it contains all specified tags. If None, no tag filtering is applied.

Returns:

A list of benchmark problem instances matching the specified filtering criteria.

Return type:

list[BenchmarkProblem]

Examples

Retrieve all single-objective, mono-fidelity problems, with no constraints:

>>> problems = list_problems(num_obj=[1, 1], num_cstr=[0, 0], num_fidelity=[1, 1])

Retrieve all single-objective, multi-fidelity problems:

>>> problems = list_problems(num_fidelity=[2, np.inf])

Retrieve all dimension variable benchmark problems:

>>> problems = list_problems(tags=["n_variable"])

Module contents#