11 #ifndef DIGNEA_BINARYTOURNAMENTSELECTION_H
12 #define DIGNEA_BINARYTOURNAMENTSELECTION_H
14 #include <dignea/core/Selection.h>
15 #include <dignea/utilities/random/PseudoRandom.h>
29 void select(
const vector<S> &,
int &)
override;
31 S
select(
const vector<S> &population)
override;
33 std::string getName()
const override {
34 return "Binary Tournament Selection";
48 int popSize = population.size() - 1;
51 int parent1 = min(firstOption, secondOption);
52 S result = population[parent1];
68 int popSize = population.size() - 1;
71 parent = min(firstOption, secondOption);
Binary Tournament Selection Operator.
Definition: BinaryTournamentSelection.h:23
void select(const vector< S > &, int &) override
Performs the Binary Tournament Selection operator over the population and sets the index of the paren...
Definition: BinaryTournamentSelection.h:66
static int randInt(int minBound, int maxBound)
Returns a random integer int the range [minBound, maxBound].
Definition: PseudoRandom.cpp:38
Abstract Selection interface.
Definition: Selection.h:21