metaheuristic_designer.strategies.no_search module#
No-op strategy that returns the population unchanged (debug / baseline).
- class NoSearch(initializer, name='No search', **kwargs)[source]#
Bases:
SearchStrategyDebug strategy that does nothing.
The population is never modified. Useful as a baseline or for testing other components in isolation.
- Parameters:
- initializerInitializer
Population initializer.
- namestr, optional
Display name (default
"No search").- **kwargs
Forwarded to
SearchStrategy.
- Attributes:
paramsAccess parameter values by attribute-style lookup.
population_sizeGets the amount of individuals in the population.
- Parameters:
initializer (Initializer)
name (str)
Methods
extra_report()Hook called at the end of the optimization (intended for subclasses).
extra_step_info()Hook called after each generation (intended for subclasses).
gather_parameters()Collect the current parameters from all sub-components.
get_params()Return a copy of the current parameter dictionary.
get_state()Gets the current state of the search strategy as a dictionary.
initialize(objfunc)Initializes the optimization search strategy.
step(prev_population, objfunc)Performs a single iteration of the algorithm on a given population.
store_kwargs([progress])Store keyword arguments and evaluate them at the given progress.
update(progress)Advances the state of the search by one iteration.
update_kwargs([progress])Add or replace parameters and immediately evaluate them.
reset
- step(prev_population, objfunc)[source]#
Performs a single iteration of the algorithm on a given population.
- Return type:
- Parameters:
- populationPopulation
Population of solutions in which to perform the operators.
- Returns:
- Population
Next population after performing all the steps in the iteration.
- Parameters:
prev_population (Population)
objfunc (ObjectiveFunc)