HybridFunction5#

class HybridFunction5(n_dim: int = 10, objective: str = 'minimize', modifiers: List[BaseModifier] | None = None, memory: bool = False, collect_data: bool = True, callbacks: Callable | List[Callable] | None = None, catch_errors: Dict[type, float] | None = None)[source]#

F21: Hybrid Function 5.

Combines: Expanded Scaffer, HGBat, Rosenbrock, High Conditioned Elliptic.

Properties: - Multimodal - Non-separable - Scalable

__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.

property callbacks[source]#

Callback management (CallbackAccessor).

property data[source]#

Evaluation data (DataAccessor).

property errors[source]#

Error handler management (ErrorAccessor).

property f_global: float[source]#

Global optimum value for this function.

CEC 2014 formula: f* = func_id * 100

property func_id: int | None[source]#

Function ID within the CEC suite.

property memory[source]#

Memory cache management (MemoryAccessor).

property meta[source]#

Function metadata (MetaAccessor).

property modifiers[source]#

Modifier management (ModifierAccessor).

property plot[source]#

Access plotting methods for this function.

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.

Parameters:
  • params (dict, array, list, or tuple) – Parameter values to evaluate.

  • **kwargs (dict) – Parameters as keyword arguments.

Returns:

The true function value without modifiers, with direction applied.

Return type:

float or np.ndarray

reset() None[source]#

Reset all state including collected data and memory cache.

property search_space: Dict[str, Any][source]#

Search space for this function (read-only public API).

property spec[source]#

Function characteristics (SpecAccessor).

property x_global: ndarray | None[source]#

Global optimum location (the shift vector).