Generic optimization utilities#
- pygmo.sbx_crossover(parent1, parent2, bounds, nix, p_cr, eta_c, seed)#
This function will perform a binary crossover on the continuous parts of the two chromosomes parent1 and parent2 and a two-point crossover on their integer parts. The crossover will only happen with a probability p_cr. If that is the case, each continuous component of the chromosomes will be crossovered with a probability of 0.5.
- Parameters
parent1 (array-like object) – a first chromosome
parent2 (array-like object) – a second chromosome
bounds (2-D array-like object) – problem bounds
nix (
int
) – the integer dimension of the chromosomep_cr (
float
) – crossover probabilityeta_c (
float
) – crossover distribution indexseed (
int
) – seed used by the internal random number generator
- Returns
of
numpy.ndarray
: containing the two crossovered chromosomes- Return type
- Raises
ValueError – if bounds parent1 parent2 are not of equal length, if lower bounds are not less or equal to the upper bounds, if the nix is larger than the parent size or if infinite values are detected in bounds, p_cr or eta_c
unspecified – any exception thrown by failiures at the intersection between C++ and Python (e.g., type conversion errors, mismatched function signatures, etc.)
See also the docs of the C++ class
pagmo::sbx_crossover
.
- pygmo.polynomial_mutation(dv, bounds, nix, p_m, eta_m, seed)#
This function will perform a polynomial mutation over the continuous part of the chromosme dv and a uniform mutation on the remaining integer part.
- Parameters
- Returns
of
numpy.ndarray
: containing the two crossovered chromosomes- Return type
- Raises
ValueError – if bounds and dv are not of equal length, if lower bounds are not less or equal to the upper bounds, if the nix is larger than the parent size or if infinite values are detected in bounds, p_m or eta_m
unspecified – any exception thrown by failiures at the intersection between C++ and Python (e.g., type conversion errors, mismatched function signatures, etc.)
See also the docs of the C++ class
pagmo::polynomial_mutation
.