metaheuristic_designer.strategies.eda_strategy module#

Strategy that generates solutions from a model.

class EDAStrategy(initializer, operator, parent_sel=None, survivor_sel=None, name='Static Population Evolution', rng=None, **kwargs)[source]#

Bases: SearchStrategy

Population-based strategy with constant size and no parent selection.

The entire population is perturbed each generation. By default, parent selection is the identity (all individuals are used) and survivor selection is generational (offspring replace parents).

Parameters:
initializerInitializer

Population initializer.

operatorOperator

Perturbation operator.

parent_selParentSelection, optional

Parent selection; defaults to identity (keep all).

survivor_selSurvivorSelection, optional

Survivor selection; defaults to generational replacement.

namestr, optional

Display name (default "Static Population Evolution").

rngRNGLike, optional

Random number generator.

**kwargs

Forwarded to SearchStrategy.

Attributes:
params

Access parameter values by attribute-style lookup.

population_size

Gets the amount of individuals in the population.

Parameters:

Methods

estimate_parameters(population)

Utilizes the samples present in the input population to estimate the parameters used by the operator.

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

abstract estimate_parameters(population)[source]#

Utilizes the samples present in the input population to estimate the parameters used by the operator.

Return type:

Operator

Parameters:
populationPopulation

Data to use for estimating parameters.

Returns:
Operator

Newly configured operator.

Parameters:

population (Population)

step(prev_population, objfunc)[source]#

Performs a single iteration of the algorithm on a given population.

Return type:

Population

Parameters:
populationPopulation

Population of solutions in which to perform the operators.

Returns:
Population

Next population after performing all the steps in the iteration.

Parameters: