saealib.DuplicateElimination#

class saealib.DuplicateElimination(atol=1e-16, rtol=0.0, max_retries=100)[source]#

Bases: object

Filter offspring that duplicate any member of the current population.

Parameters:
  • atol (float) – Absolute tolerance passed to numpy.isclose. Matches the atol semantics of ArchiveMixin.

  • rtol (float) – Relative tolerance passed to numpy.isclose. Matches the rtol semantics of ArchiveMixin.

  • max_retries (int) – Maximum number of regeneration attempts per ask() call.

Methods

__init__

contract

Return the duplicate-filter contract.

find_duplicates

Return a boolean mask of offspring that duplicate the population.

Method Details

DuplicateElimination.__init__(atol=1e-16, rtol=0.0, max_retries=100)#
Parameters:
  • atol (float)

  • rtol (float)

  • max_retries (int)

Return type:

None

DuplicateElimination.contract()[source]#

Return the duplicate-filter contract.

Return type:

ComponentContract

DuplicateElimination.find_duplicates(off_x, pop_x)[source]#

Return a boolean mask of offspring that duplicate the population.

Parameters:
  • off_x (numpy.ndarray of shape (N, dim)) – Offspring decision vectors.

  • pop_x (numpy.ndarray of shape (M, dim)) – Current population decision vectors.

Returns:

True where off_x[i] is element-wise close to any row of pop_x, using the same atol / rtol as _find_idx().

Return type:

numpy.ndarray of shape (N,), dtype bool