panobbgo.lib.classic.Branin#

class panobbgo.lib.classic.Branin(a: float = 1, b: float = 0.12918450914398066, c: float = 1.5915494309189535, r: float = 6, s: float = 10, t: float = 0.039788735772973836, **kwargs: Any)[source]#

BRANIN test problem [branin]

\[ \begin{align}\begin{aligned}F(X) = a(x_2 - b x_1^2 + c x_1 - r)^2 + s(1-t) \cos(x_1) + s\\a = 1,\,b = 5.1 ⁄ (4 π^2),\, c = 5 ⁄ π,\, r = 6,\, s = 10 and t = 1 ⁄ (8π)\end{aligned}\end{align} \]

Global minimum \(5/(4\pi) \approx 0.397887\) at \((-\pi, 12.275)\), \((\pi, 2.275)\) and \((3\pi, 2.475)\). (The default t was 1, which cancels the cosine term.)

Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

__init__(a: float = 1, b: float = 0.12918450914398066, c: float = 1.5915494309189535, r: float = 6, s: float = 10, t: float = 0.039788735772973836, **kwargs: Any)[source]#
Parameters:
  • box (list) – list of tuples for the bounding box with length n, e.g.: \(\left[ (-1,1), (-100, 0), (0, 0.01) \right]\).

  • dx (list) – translation of the whole problem, an n-dimensional vector (default: None). The search box becomes box + dx and the objective is evaluated at x - dx, i.e. the problem seen by the optimiser is \(g(x) = f(x - dx)\) and a minimiser \(x^*\) of \(f\) moves to \(x^* + dx\). Every point the objective sees lies in the original box.

Methods

__init__([a, b, c, r, s, t])

eval(x)

This is called to evaluate the given black-box function.

eval_constraints(x)

This method is optionally overwritten by the problem to calculate the constraint violations.

project(point)

projects given point into the search box.

random_point([distribution, rng])

Generates a random point inside the given search box.

Attributes

box

The bounding box for this problem, a \((\mathit{dim},2)\)-array.

center

center of the box

dim

The number of dimensions.

ranges

The ranges along each dimension, a numpy.ndarray.