20 #ifndef ANTKEEPER_GAME_ANT_GENE_FREQUENCY_TABLE_HPP
21 #define ANTKEEPER_GAME_ANT_GENE_FREQUENCY_TABLE_HPP
51 template <
class Generator>
57 std::discrete_distribution<std::size_t> distribution(
weights.begin(),
weights.end());
58 return genes[distribution(g)];
std::vector< const T * > genes
Gene array.
std::vector< float > weights
Weight array.
const T * sample(Generator &g) const
Samples a gene from the frequency table.