evolvepy.generator.crossover package

Submodules

evolvepy.generator.crossover.crossover module

evolvepy.generator.crossover.crossover.mean(chromosomes: int | float | complex | str | bytes | generic | Sequence[int | float | complex | str | bytes | generic] | Sequence[Sequence[Any]] | _SupportsArray) ndarray[source]

Crossover computing the mean of chromosomes

Parameters:

chromosomes (np.typing.ArrayLike) – array of chromosomes

Returns:

new chromosome.

Return type:

np.ndarray

evolvepy.generator.crossover.crossover.n_point(chromosomes: int | float | complex | str | bytes | generic | Sequence[int | float | complex | str | bytes | generic] | Sequence[Sequence[Any]] | _SupportsArray, n: int = 1) array[source]

Crossover joining in n points

Parameters:
  • chromosomes (np.typing.ArrayLike) – array of chromosomes

  • n (int) – number of points to join

Returns:

new chromosome.

Return type:

np.ndarray

evolvepy.generator.crossover.crossover.one_point(chromosomes: int | float | complex | str | bytes | generic | Sequence[int | float | complex | str | bytes | generic] | Sequence[Sequence[Any]] | _SupportsArray) array[source]

Crossover joining in one point :param chromosomes: array of chromosomes :type chromosomes: np.typing.ArrayLike

Returns:

new chromosome.

Return type:

np.ndarray

Module contents

EvolvePy’s crossover. Objects that can be called upon during evolution to exchange chromosomes on 1 or more points.