evol.helpers package

Submodules

evol.helpers.pickers module

evol.helpers.pickers.pick_random(parents: Sequence[evol.individual.Individual], n_parents: int = 2) → Tuple[source]

Randomly selects parents with replacement

Accepted arguments:
n_parents: Number of parents to select. Defaults to 2.

evol.helpers.utils module

evol.helpers.utils.rotating_window([1, 2, 3, 4]) → [(4,1), (1,2), (2,3), (3,4)][source]
evol.helpers.utils.select_partition(length: int, min_size: int = 1, max_size: int = None) → Tuple[int, int][source]

Select a partition of a chromosome.

Parameters:
  • length – Length of the chromosome.
  • min_size – Minimum length of the partition. Defaults to 1.
  • max_size – Maximum length of the partition. Defaults to length - 1.
Returns:

Start and end index of the partition.

evol.helpers.utils.sliding_window([1, 2, 3, 4]) → [(1,2), (2,3), (3,4)][source]

Module contents

Helpers in evol are functions that help you when you are designing algorithms. We archive these helping functions per usecase.