Implements one-point crossover. More...
#include <shark/Algorithms/DirectSearch/Operators/Recombination/OnePointCrossover.h>
Public Member Functions | |
template<class randomType , typename PointType > | |
PointType | operator() (randomType &rng, const PointType &mom, const PointType &dad) |
Performs the one-point crossover. More... | |
Implements one-point crossover.
Given two input points of same size n, draws a random number between 0 and n-1. all variables smaller than this index have the value of the left, all elements to the right have the value of the right parent.
Definition at line 43 of file OnePointCrossover.h.
|
inline |
Performs the one-point crossover.
Definition at line 46 of file OnePointCrossover.h.
References shark::random::discrete(), and SIZE_CHECK.