Developer API for benchmarking problems

class smt.problems.problem.Problem(**kwargs)[source]
Attributes:
design_space

Gets the design space definitions as an instance of BaseDesignSpace

Methods

__call__(x[, kx])

Evaluate the function.

sample

_initialize() None[source]

Implemented by problem to declare options (optional).

Examples

self.options.declare(‘option_name’, default_value, types=(bool, int), desc=’description’)

_evaluate(x: ndarray, kx: int | None = None) ndarray[source]

Implemented by surrogate models to evaluate the function.

Parameters:
xndarray[n, nx]

Evaluation points where n is the number of evaluation points.

kxint or None

Index of derivative (0-based) to return values with respect to. None means return function value rather than derivative.

Returns:
ndarray[n, 1]

Functions values if kx=None or derivative values if kx is an int.

_set_design_space(design_space: BaseDesignSpace)[source]

Set the design space definition (best is to use the smt.utils.design_space.DesignSpace class directly) of this problem from the _setup function. If used, there is no need to set xlimits.