metaheuristic_designer.operators.adaptive_operator module#

Adaptive operator that updates its parameters from the genotype.

class AdaptiveOperator(base_operator, param_operators, encoding, name=None, **kwargs)[source]#

Bases: ExtendedOperator

Operator that dynamically adapts its base operator’s parameters.

At each generation, the parameters encoded in the genotype are decoded and used to update the base operator before applying it to the population. This enables self-adaptive algorithms (e.g., Evolution Strategies with evolving mutation strengths).

See ExtendedOperator for constructor parameters.

Attributes:
params

Access parameter values by attribute-style lookup.

Parameters:

Methods

__call__(population)

Shorthand for evolve().

evolve(population)

Decode parameters, update the base operator, then apply it.

gather_params()

Collect parameters from the base operator and all parameter operators.

get_params()

Return a copy of the current parameter dictionary.

get_state()

Gets the current state of the algorithm as a dictionary.

store_kwargs([progress])

Store keyword arguments and evaluate them at the given progress.

update(progress)

Update schedulable parameters and propagate to sub-operators.

update_kwargs([progress])

Add or replace parameters and immediately evaluate them.

evolve(population)[source]#

Decode parameters, update the base operator, then apply it.

Return type:

Population

Parameters:
populationPopulation

The current population (whose genotype contains the parameters).

Returns:
Population

The evolved population.

Parameters:

population (Population)