panobbgo.lib.classic.Rastrigin#
- class panobbgo.lib.classic.Rastrigin[source]#
- \[f(x) = \mathit{par}_1 \cdot n + \sum_i (x_i^2 - 10 \cos(2 \pi x_i) )\]
- 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 + dxand the objective is evaluated atx - 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 originalbox.
- __init__(dims: int, par1: float = 10, offset: float = 0, box: Sequence[Tuple[float, float]] | None = None, **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 + dxand the objective is evaluated atx - 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 originalbox.
Methods
__init__(dims[, par1, offset, box])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
boxThe bounding box for this problem, a \((\mathit{dim},2)\)-
array.centercenter of the box
dimThe number of dimensions.
rangesThe ranges along each dimension, a
numpy.ndarray.