28 int P =
pop.individuals.size()/2;
30 vector<size_t> selected(P);
32 std::iota(selected.begin(),selected.end(),P);
34 if (selected.at(selected.size()-1) >
pop.size())
36 to_string(selected.at(selected.size()-1)) +
41 size_t best_idx, worst_idx;
42 float min_fit, max_fit;
44 for (
unsigned i = 0;
i <
pop.individuals.size(); ++
i)
46 if (
pop.individuals.at(
i).fitness < min_fit ||
i == 0)
48 min_fit =
pop.individuals.at(
i).fitness;
53 if (
pop.individuals.at(
i).fitness > max_fit ||
i == P)
55 max_fit =
pop.individuals.at(
i).fitness;
62 selected.at(worst_idx - P) = best_idx;
data holding X, y, and Z data
#define THROW_LENGTH_ERROR(err)
std::string to_string(const T &value)
template function to convert objects to string for logging
holds the hyperparameters for Feat.
Defines a population of programs and functions for constructing them.
vector< size_t > survive(Population &pop, const Parameters ¶ms, const Data &d)