41 if (mutation_rate <= 0.0) {
return; }
43 thread_local static std::random_device rd;
44 thread_local static std::mt19937 gen(rd());
45 thread_local static std::uniform_real_distribution<double> distribution(0.0, 1.0);
46 thread_local static std::normal_distribution<double> gaussian_distribution;
48 std::vector<GeneType>& genotype = individual.
getGenotype();
50 for (std::size_t i = 0; i < genotype.size(); ++i) {
51 if (distribution(gen) < mutation_rate) {
52 genotype[i] += gaussian_distribution(gen, std::normal_distribution<double>::param_type(0.0, sigma_m));