saealib.TruncationSelection#
- class saealib.TruncationSelection(randomize_ties=False)[source]#
Bases:
SurvivorSelectionTruncation selection operator.
- Parameters:
randomize_ties (bool)
- randomize_ties#
When True, individuals tied at the truncation boundary (equal under
comparator.compare_population) are shuffled before truncating, matching pymoo’srandomized_argsorttreatment of the splitting front. When False (default), ties keep the order returned bycomparator.rank_population(deterministic).- Type:
bool
Methods
Initialize truncation selection operator. |
|
Return the truncation-selection contract. |
|
Select survivors by truncating the sorted pool. |
Method Details
- TruncationSelection.__init__(randomize_ties=False)[source]#
Initialize truncation selection operator.
- Parameters:
randomize_ties (bool, optional) – Randomize the order of individuals tied at the truncation boundary, by default False.
- TruncationSelection.select(ctx, pool, n_survivors)[source]#
Select survivors by truncating the sorted pool.
- 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