shark::PartiallyMappedCrossover Struct Reference

Implements partially mapped crossover. More...

#include <shark/Algorithms/DirectSearch/Operators/Recombination/PartiallyMappedCrossover.h>

Public Member Functions

template<class Rng , typename IndividualType >
void operator() (Rng &rng, IndividualType &individual1, IndividualType &individual2) const
 Mates the supplied individuals. More...
 
template<typename Archive >
void serialize (Archive &, const unsigned int)
 Serializes this instance to the supplied archive. More...
 

Detailed Description

Implements partially mapped crossover.

PartiallyMappedCrossover recombines points representing permutations, i.e. it ensures that the results are also permutations.

Definition at line 13 of file PartiallyMappedCrossover.h.

Member Function Documentation

◆ operator()()

template<class Rng , typename IndividualType >
void shark::PartiallyMappedCrossover::operator() ( Rng &  rng,
IndividualType individual1,
IndividualType individual2 
) const
inline

Mates the supplied individuals.

Parameters
[in,out]individual1Individual to be mated.
[in,out]individual2Individual to be mated.

Definition at line 20 of file PartiallyMappedCrossover.h.

References shark::random::discrete(), shark::Individual< PointType, FitnessTypeT, Chromosome >::searchPoint(), and SIZE_CHECK.

◆ serialize()

template<typename Archive >
void shark::PartiallyMappedCrossover::serialize ( Archive &  ,
const unsigned  int 
)
inline

Serializes this instance to the supplied archive.

Definition at line 76 of file PartiallyMappedCrossover.h.


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