-
Notifications
You must be signed in to change notification settings - Fork 1
/
selection.hpp
27 lines (26 loc) · 1023 Bytes
/
selection.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* selection.hpp
*
* This namespace has all of the different implementations of the population
* selection of the evolutionary algorithm.
*/
#include "structures.hpp"
namespace selection{
/* selection_1 test
*
* The function takes a reference to the current population
* and the amount of requested parents as parameter
* and returns, based on random tournament and fitness,
* a vector of iterators to individuals within the population
* containing the parents
*
*
* parameters: std::vector<individual> &population, int parents_amount
* return: std::vector<std::vector<individual>::iterator> parent_iterators
*/
std::vector<std::vector<individual>::iterator> selection_1(
std::vector<individual> &population,int parents_amount);
// returns an iterator to the best individual
std::vector<individual>::iterator get_best_fitness(std::vector<individual> &population);
// returns an iterator to the worst individual
std::vector<individual>::iterator get_worst_fitness(std::vector<individual> &population);
}