dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
SwapMutation< S > Class Template Reference

Swap Mutation Operator for Permutation Based Problems like TSP. Fixes the first and last genes to zero (TSP constraint). More...

#include <SwapMutation.h>

Inheritance diagram for SwapMutation< S >:
Mutation< S >

Public Member Functions

void run (S &ind, const double &probability, Problem< S > *) override
 Performs Swap Mutation Operation. More...
 
std::string getName () const override
 

Detailed Description

template<class S>
class SwapMutation< S >

Swap Mutation Operator for Permutation Based Problems like TSP. Fixes the first and last genes to zero (TSP constraint).

Template Parameters
S

Member Function Documentation

◆ run()

template<class S >
void SwapMutation< S >::run ( S &  ind,
const double &  probability,
Problem< S > *  problem 
)
overridevirtual

Performs Swap Mutation Operation.

Two positions (genes) in the chromosome are selected at random and their allele values swapped.

Template Parameters
S
Parameters
ind
probability
problem

Implements Mutation< S >.


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