saealib.SurvivorSelection#

class saealib.SurvivorSelection[source]#

Bases: ABC

Base class for survivor selection operators.

Methods

__init__

contract

Return the survivor-selection contract.

select

Select survivors from the selection pool.

Method Details

SurvivorSelection.__init__()#
SurvivorSelection.contract()[source]#

Return the survivor-selection contract.

Return type:

ComponentContract

abstractmethod SurvivorSelection.select(ctx, pool, n_survivors)[source]#

Select survivors from the selection pool.

The pool is a merged Population (e.g., parents + offspring) constructed by the Algorithm. The replacement strategy (μ+λ or μ,λ) is determined by the Algorithm, not by this class.

Parameters:
  • ctx (ExecutionContext) – Optimization context.

  • pool (Population) – Selection pool to choose survivors from.

  • n_survivors (int) – Number of survivors to select.

Returns:

Indices of selected survivors in the pool.

Return type:

np.ndarray