Brush C++ API
A flexible interpretable machine learning framework
Loading...
Searching...
No Matches
selection_operator.h
Go to the documentation of this file.
1#ifndef SELECTION_OPERATOR_H
2#define SELECTION_OPERATOR_H
3
4// virtual class. selection must be made with static methods
5
6// #include "../init.h"
7// #include "../data/data.h"
8// #include "../types.h"
9// #include "../params.h"
10#include "../pop/population.h"
11
12namespace Brush {
13namespace Sel {
14
15using namespace Brush;
16using namespace Pop;
17
22template<ProgramType T>
29{
30public:
31 bool survival;
32 string name;
37 virtual ~SelectionOperator();
38
47 virtual vector<size_t> select(Population<T>& pop, int island, const Parameters& p);
48
57 virtual vector<size_t> survive(Population<T>& pop, int island, const Parameters& p);
58};
59
60} // selection
61} // Brush
62#endif
void bind_engine(py::module &m, string name)
The SelectionOperator class represents a base class for selection operators in a genetic algorithm.
virtual vector< size_t > select(Population< T > &pop, int island, const Parameters &p)
Selects individuals from the population based on the selection operator's strategy.
virtual ~SelectionOperator()
Destructor for the SelectionOperator class.
virtual vector< size_t > survive(Population< T > &pop, int island, const Parameters &p)
Applies the selection operator to determine which individuals survive in the population.
< nsga2 selection operator for getting the front
Definition data.cpp:12