saealib.TruncationSelection

class saealib.TruncationSelection[source]

Bases: SurvivorSelection

Truncation selection operator.

Methods

__init__

select

Select survivors by truncating the sorted pool.

Method Details

TruncationSelection.__init__()
TruncationSelection.select(ctx, pool, n_survivors)[source]

Select survivors by truncating the sorted pool.

Parameters:
  • ctx (OptimizationContext) – 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