Uniform crossover of arbitrary individuals. More...
#include <shark/Algorithms/DirectSearch/Operators/Recombination/UniformCrossover.h>
Public Member Functions | |
UniformCrossover (double mixingRatio=0.5) | |
Default c'tor, initializes the per element probability. More... | |
template<class randomType , typename Point > | |
Point | operator() (randomType &rng, const Point &mom, const Point &dad) const |
Executes the uniform crossover. More... | |
double | mixingRatio () const |
Returns the mixing ratio \( \in [0,1]\). More... | |
void | setMixingRatio (double newRatio) |
Sets the mixing ratio to \( \in [0,1]\). More... | |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serializes instances of the uniform crossover operator. More... | |
Uniform crossover of arbitrary individuals.
Mixes individual genes of parent individuals according to a fixed mixing ratio. See http://en.wikipedia.org/wiki/Crossover_(genetic_algorithm) for further details.
Definition at line 44 of file UniformCrossover.h.
|
inline |
Default c'tor, initializes the per element probability.
[in] | mixingRatio | Mixing ratio between parent individuals. |
Definition at line 50 of file UniformCrossover.h.
References mixingRatio(), and setMixingRatio().
|
inline |
Returns the mixing ratio \( \in [0,1]\).
Definition at line 71 of file UniformCrossover.h.
Referenced by UniformCrossover().
|
inline |
Executes the uniform crossover.
Definition at line 58 of file UniformCrossover.h.
|
inline |
Serializes instances of the uniform crossover operator.
Definition at line 85 of file UniformCrossover.h.
|
inline |
Sets the mixing ratio to \( \in [0,1]\).
Definition at line 77 of file UniformCrossover.h.
References SHARK_RUNTIME_CHECK.
Referenced by UniformCrossover().