saealib.TruncationSelection#

class saealib.TruncationSelection(randomize_ties=False)[ソース]#

ベースクラス: SurvivorSelection

Truncation selection operator.

パラメータ:

randomize_ties (bool)

randomize_ties#

When True, individuals tied at the truncation boundary (equal under comparator.compare_population) are shuffled before truncating, matching pymoo's randomized_argsort treatment of the splitting front. When False (default), ties keep the order returned by comparator.rank_population (deterministic).

Type:

bool

Methods

__init__

Initialize truncation selection operator.

contract

Return the truncation-selection contract.

select

Select survivors by truncating the sorted pool.

Method Details

TruncationSelection.__init__(randomize_ties=False)[ソース]#

Initialize truncation selection operator.

パラメータ:

randomize_ties (bool, optional) -- Randomize the order of individuals tied at the truncation boundary, by default False.

TruncationSelection.contract()[ソース]#

Return the truncation-selection contract.

戻り値の型:

ComponentContract

TruncationSelection.select(ctx, pool, n_survivors)[ソース]#

Select survivors by truncating the sorted pool.

パラメータ:
  • ctx (ExecutionContext) -- Optimization context.

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

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

戻り値:

Indices of selected survivors in the pool.

戻り値の型:

np.ndarray