GALib-Parallel
Header-only C++ library for parallel evolutionary algorithms
Loading...
Searching...
No Matches
Crossover.h
Go to the documentation of this file.
1#ifndef CROSSOVER_H
2#define CROSSOVER_H
3
4#pragma once
5
6#include "core/Individual.h"
7#include <utility>
8
9namespace galib {
10
19 template <typename GeneType>
20 class Crossover {
21 public:
22 virtual ~Crossover() = default;
23
31 virtual std::pair<Individual<GeneType>, Individual<GeneType>> crossover (
32 const Individual<GeneType>& parent1, const Individual<GeneType>& parent2) = 0;
33 };
34
35}
36
37#endif // CROSSOVER_H
Interface for crossover (recombination) operators.
Definition Crossover.h:20
virtual ~Crossover()=default
virtual std::pair< Individual< GeneType >, Individual< GeneType > > crossover(const Individual< GeneType > &parent1, const Individual< GeneType > &parent2)=0
Performs crossover between two parents.
Represents a single candidate solution in the population.
Definition Individual.h:23