SimionescuFunction#
- class SimionescuFunction(A=0.1, r_T=1, r_S=0.2, n=8, objective='minimize', modifiers: List[BaseModifier] | None = None, memory=False, collect_data=True, callbacks=None, catch_errors=None)[source]#
Simionescu two-dimensional constrained test function.
A function with a bumpy constraint boundary. Points outside the constraint region return NaN.
The function is defined as:
\[f(x, y) = Axy\]Subject to:
\[x^2 + y^2 \le [r_T + r_S \cos(n \arctan(x/y))]^2\]where \(A = 0.1\), \(r_T = 1\), \(r_S = 0.2\), and \(n = 8\) by default.
The global minimum is \(f(\pm 0.84852813, \mp 0.84852813) = -0.072\).
- Parameters:
A (float, default=0.1) – Amplitude scaling parameter.
r_T (float, default=1) – Constraint radius parameter.
r_S (float, default=0.2) – Constraint wave amplitude.
n (int, default=8) – Number of bumps in the constraint boundary.
metric (str, default="score") – Either “loss” (minimize) or “score” (maximize).
modifiers (list of BaseModifier, optional) – List of modifiers to apply to function evaluations.
Examples
>>> from surfaces.test_functions import SimionescuFunction >>> func = SimionescuFunction() >>> result = func({"x0": 0.84852813, "x1": -0.84852813})
- __call__(params: Dict[str, Any] | ndarray | list | tuple | None = None, **kwargs)[source]#
Evaluate the objective function.
- Args:
params: Parameter values as dict, array, list, or tuple **kwargs: Parameters as keyword arguments (only with dict input)
- Returns:
The objective function value
- batch(X: ArrayLike) ArrayLike[source]#
Evaluate multiple parameter sets in a single call.
- Parameters:
X (ArrayLike) – 2D array of shape (n_points, n_dim) where each row is a parameter set.
- Returns:
1D array of shape (n_points,) with evaluation results.
- Return type:
ArrayLike
- Raises:
NotImplementedError – If the function does not implement _batch_objective.
ValueError – If X has wrong number of dimensions or wrong n_dim.
- pure(params: Dict[str, Any] | ndarray | list | tuple | None = None, **kwargs)[source]#
Evaluate the function without modifiers.
Returns the true (deterministic) function value, bypassing any configured modifiers. Does not update search_data, n_evaluations, or callbacks. Ignores memory caching.