dignea  1.0.0
Diverse Instance Generator with Novelty Search and Evolutionary Algorithms
Selection.h
1 //
2 // Created by amarrero on 1/12/20.
3 //
4 
5 #ifndef DIGNEA_SELECTION_H
6 #define DIGNEA_SELECTION_H
7 
8 #include <dignea/core/Solution.h>
9 
10 #include <memory>
11 #include <random>
12 
13 using namespace std;
14 
20 template <class S>
21 class Selection {
22  public:
23  Selection() = default;
24 
25  virtual ~Selection() = default;
26 
27  public:
35  virtual S select(const vector<S> &population) = 0;
36 
47  virtual void select(const vector<S> &population, int &parent) = 0;
48 
49  virtual std::string getName() const = 0;
50 };
51 
52 #endif // DIGNEA_SELECTION_H
Abstract Selection interface.
Definition: Selection.h:21
virtual S select(const vector< S > &population)=0
Method to perform the selection operation. This is a virtual method that must be implemented in the s...
virtual void select(const vector< S > &population, int &parent)=0
Method to perform the selection operation. This is a virtual method that must be implemented in the s...