shark::UniformCrossover Class Reference

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...

Detailed Description

Uniform crossover of arbitrary individuals.

Mixes individual genes of parent individuals according to a fixed mixing ratio. See for further details.

Definition at line 44 of file UniformCrossover.h.

Constructor & Destructor Documentation

◆ UniformCrossover()

shark::UniformCrossover::UniformCrossover ( double  mixingRatio = 0.5)

Default c'tor, initializes the per element probability.

[in]mixingRatioMixing ratio between parent individuals.

Definition at line 50 of file UniformCrossover.h.

References mixingRatio(), and setMixingRatio().

Member Function Documentation

◆ mixingRatio()

double shark::UniformCrossover::mixingRatio ( ) const

Returns the mixing ratio \( \in [0,1]\).

Definition at line 71 of file UniformCrossover.h.

Referenced by UniformCrossover().

◆ operator()()

template<class randomType , typename Point >
Point shark::UniformCrossover::operator() ( randomType &  rng,
const Point &  mom,
const Point &  dad 
) const

Executes the uniform crossover.

The offspring individual.

Definition at line 58 of file UniformCrossover.h.

◆ serialize()

template<typename Archive >
void shark::UniformCrossover::serialize ( Archive &  ar,
const unsigned int  version 

Serializes instances of the uniform crossover operator.

Definition at line 85 of file UniformCrossover.h.

◆ setMixingRatio()

void shark::UniformCrossover::setMixingRatio ( double  newRatio)

Sets the mixing ratio to \( \in [0,1]\).

Definition at line 77 of file UniformCrossover.h.


Referenced by UniformCrossover().

The documentation for this class was generated from the following file: