saealib.SequentialSelection#

class saealib.SequentialSelection[source]#

Bases: ParentSelection

Sequential selection operator.

Methods

__init__

contract

Return the parent-selection contract.

select

Execute sequential selection.

Method Details

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

Return the parent-selection contract.

Return type:

ComponentContract

SequentialSelection.select(ctx, population, n_pair, n_parents, rng=Generator(PCG64) at 0x7F7917917760)[source]#

Execute sequential selection.

Assign parents sequentially without any fitness-based comparison.

Parameters:
  • ctx (ExecutionContext) – Optimization context.

  • population (Population) – Population to select from.

  • n_pair (int) – Number of pairs to select.

  • n_parents (int) – Number of parents per pair.

  • rng (np.random.Generator, optional) – Random number generator, by default np.random.default_rng()

Returns:

Selected parent indices. shape = (n_pair, n_parents)

Return type:

np.ndarray