Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
selection.h
Go to the documentation of this file.
1/* Brush
2copyright 2020 William La Cava
3license: GNU/GPL v3
4*/
5
6#ifndef SELECTION_H
7#define SELECTION_H
8
10#include "nsga2.h"
11#include "lexicase.h"
12
13namespace Brush {
14namespace Sel {
15
16using namespace Brush;
17using namespace Pop;
18
23template<ProgramType T>
25{
26public:
27 SelectionOperator<T>* pselector; // TODO: THIS SHOULD BE A SHARED POINTER
28 string type;
30
31 Selection();
33 Selection(string type, bool survival);
34
35 void set_operator();
36
38 string get_type();
39 void set_type(string);
40
42 vector<size_t> select(Population<T>& pop, int island,
43 const Parameters& params);
44
46 vector<size_t> survive(Population<T>& pop, int island,
47 const Parameters& params);
48};
49
50} // Sel
51} // Brush
52#endif
void bind_engine(py::module &m, string name)
The SelectionOperator class represents a base class for selection operators in a genetic algorithm.
< nsga2 selection operator for getting the front
Definition data.cpp:12
interfaces with selection operators.
Definition selection.h:25
vector< size_t > select(Population< T > &pop, int island, const Parameters &params)
perform selection. selection uses a pop that has no offspring space
Definition selection.cpp:51
string get_type()
return type of selectionoperator
Definition selection.cpp:43
void set_type(string)
set type of selectionoperator
Definition selection.cpp:47
vector< size_t > survive(Population< T > &pop, int island, const Parameters &params)
perform survival. uses a pop with offspring space
Definition selection.cpp:59
SelectionOperator< T > * pselector
Definition selection.h:27