Skip to main content

SelectionHyperHeuristic

Module: opytimizer.hyperheuristics.selection.selection_hyperheuristic

A selection-based hyperheuristic that uses different strategies to select between low-level optimizers.

This hyperheuristic implements the selection approach where different low-level optimizers are selected based on their performance history and the chosen selection strategy.

Constructor​

SelectionHyperHeuristic(optimizers: Optional[List[Any]] = None, selection_strategy: Optional[opytimizer.hyperheuristics.selection_strategy.SelectionStrategy] = None, performance_metric=None, selection_interval: int = 1) -> None

Parameters​

ParameterTypeDefaultDescription
optimizersOptional[List[Any]]None—
selection_strategyOptional[opytimizer.hyperheuristics.selection_strategy.SelectionStrategy]None—
performance_metricNone—
selection_intervalint1—

Methods​

get_strategy_statistics​

get_strategy_statistics(self) -> Dict[str, Any]

Get statistics about the selection strategy.

Returns: (Dict[str, Any]): Dictionary containing strategy statistics.

select_optimizer​

select_optimizer(self, space: opytimizer.core.space._Space, function: opytimizer.core.function.Function) -> Any

Select optimizer using the configured selection strategy.

Returns: (Any): Selected optimizer.

Parameters​

ParameterTypeDefaultDescription
spaceopytimizer.core.space._SpaceCurrent search space.
functionopytimizer.core.function.FunctionObjective function.

update​

update(self, space: opytimizer.core.space._Space, function: opytimizer.core.function.Function = None) -> None

Update the search space and potentially select a new optimizer.

Parameters​

ParameterTypeDefaultDescription
spaceopytimizer.core.space._SpaceA Space object containing agents and update-related information.
functionopytimizer.core.function.FunctionNoneObjective function (optional, for optimizers that need it).