Crossover Operators

One Point

cx_one_point(ind1, ind2)

Executes a one-point crossover on the two individuals, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates

cx_messy_one_point(ind1, ind2)

Executes a messy one-point crossover on the two individuals, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates



Two Point

cx_two_point(ind1, ind2)

Executes a two-point crossover on the two individuals, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates

cx_two_point_copy(ind1, ind2)

Executes a two-point crossover on the copies of the two individuals. This should be used instead of the regular cx_two_point() operator when the individuals are based on numpy arrays to avoid incorrect mating behavior due to the specifics of the numpy array datatype.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates

cx_es_two_point(ind1, ind2)

Executes a two-point crossover on the two individuals and their evolution strategies, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates

cx_es_two_point_copy(ind1, ind2)

Executes a two-point crossover on the copies of the two individuals and their evolution strategies. This should be used instead of the regular cx_es_two_point() operator when the individuals are based on numpy arrays to avoid incorrect mating behavior due to the specifics of the numpy array datatype.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates



Matched

cx_partially_matched(ind1, ind2)

Executes a partially matched crossover on the two individuals, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates

cx_uniform_partially_matched(ind1, ind2, cx_prob)

Executes a uniform partially matched crossover on the two individuals, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • cx_prob (float) – The probability of swapping any two traits.

Returns:

Two mated individuals.

Return type:

Mates



Blend

cx_blend(ind1, ind2, alpha)

Executes a blend crossover on the two individuals, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • alpha (float) – Extent of the interval in which the new values can be drawn for each attribute on both sides of the parents’ attributes.

Returns:

Two mated individuals.

Return type:

Mates

cx_es_blend(ind1, ind2, alpha)

Executes a blend crossover on the two individuals and their strategies, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • alpha (float) – Extent of the interval in which the new values can be drawn for each attribute on both sides of the parents’ attributes.

Returns:

Two mated individuals.

Return type:

Mates



Binary

cx_simulated_binary(ind1, ind2, eta)

Executes a simulated binary crossover on the two individuals, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • eta (float) – The crowding degree of the crossover. Higher values produce children more similar to their parents, while smaller values produce children more divergent from their parents.

Returns:

Two mated individuals.

Return type:

Mates

cx_simulated_binary_bounded(ind1, ind2, eta, low, up)

Executes a simulated binary bounded crossover on the two individuals, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • eta (float) – The crowding degree of the crossover. Higher values produce children more similar to their parents, while smaller values produce children more divergent from their parents.

  • low (NumOrSeq) – The lower bound of the search space.

  • up (NumOrSeq) – The upper bound of the search space.

Returns:

Two mated individuals.

Return type:

Mates



Other

cx_uniform(ind1, ind2, cx_prob)

Executes a uniform crossover on the two individuals, who are modified in-place.

Parameters:
  • ind1 (Individual) – The first individual.

  • ind2 (Individual) – The second individual.

  • cx_prob (float) – The probability of swapping any two traits.

Returns:

Two mated individuals.

Return type:

Mates

cx_ordered(ind1, ind2)

Executes an ordered crossover on the two individuals, who are modified in-place.

Parameters:
Returns:

Two mated individuals.

Return type:

Mates