28 return r() < 0.5 ?
i : j;
50 vector<size_t> pool(
pop.size());
51 std::iota(pool.begin(), pool.end(), 0);
56 vector<size_t> selected(
pop.size());
58 for (
int i = 0;
i <
pop.size(); ++
i)
62 selected.push_back(winner);
85 return vector<size_t>();
data holding X, y, and Z data
individual programs in the population
float fitness
aggregate fitness score
T random_choice(const vector< T > &v)
#define THROW_RUNTIME_ERROR(err)
holds the hyperparameters for Feat.
int current_gen
holds current generation
Defines a population of programs and functions for constructing them.
size_t tournament(vector< Individual > &pop, size_t i, size_t j) const
vector< size_t > survive(Population &pop, const Parameters &p, const Data &d)
survival according to the survival scheme of Tournament
vector< size_t > select(Population &pop, const Parameters &p, const Data &d)
selection according to the survival scheme of Tournament