saealib.Algorithm

class saealib.Algorithm[source]

Bases: ABC

Base class for evolutionary algorithms.

Methods

__init__

ask

Generate offspring solutions.

create_pareto_archive

Create a ParetoArchive with the correct direction for the problem.

get_required_attrs

Return the list of attributes required for Population.

tell

Update the population with offspring solutions.

Method Details

Algorithm.__init__()
abstract Algorithm.ask(ctx, provider, n_offspring=None)[source]

Generate offspring solutions.

Parameters:
  • ctx (OptimizationContext) – Context instance.

  • provider (ComponentProvider) – Provider instance.

  • n_offspring (int or None, optional) – Number of offspring to generate. If None, the algorithm determines the count (typically equal to the population size).

Returns:

Generated offspring solutions.

Return type:

Population

Algorithm.create_pareto_archive(attrs, init_capacity, problem)[source]

Create a ParetoArchive with the correct direction for the problem.

Parameters:
Return type:

ParetoArchive

abstract Algorithm.get_required_attrs(problem)[source]

Return the list of attributes required for Population.

Parameters:

problem (Problem)

Return type:

list[PopulationAttribute]

abstract Algorithm.tell(ctx, provider, offspring)[source]

Update the population with offspring solutions.

Parameters:
  • ctx (OptimizationContext) – Context instance.

  • provider (ComponentProvider) – Provider instance.

  • offspring (Population) – Offspring solutions.

Return type:

None