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. | |
| template<class randomType , typename Point > | |
| Point | operator() (randomType &rng, const Point &mom, const Point &dad) const | 
| Executes the uniform crossover. | |
| double | mixingRatio () const | 
| Returns the mixing ratio \( \in [0,1]\). | |
| void | setMixingRatio (double newRatio) | 
| Sets the mixing ratio to \( \in [0,1]\). | |
| template<typename Archive > | |
| void | serialize (Archive &ar, const unsigned int version) | 
| Serializes instances of the uniform crossover operator. | |
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.
References shark::random::coinToss().
| 
 | 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().