From e7a51448c2636c8f96a445c9d54a0a85de529b53 Mon Sep 17 00:00:00 2001 From: Joscha Date: Fri, 28 Apr 2017 13:00:30 +0000 Subject: [PATCH] Tweak Chromosome mutation probability --- src/Chromosome.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Chromosome.cpp b/src/Chromosome.cpp index 96395c9..a3fb75d 100644 --- a/src/Chromosome.cpp +++ b/src/Chromosome.cpp @@ -27,7 +27,7 @@ std::mt19937_64* Chromosome::re; Chromosome::Chromosome() { // this->genes is already empty - this->circle.setPointCount(100); + this->circle.setPointCount(50); } @@ -60,9 +60,9 @@ Chromosome::Chromosome(Chromosome& father, Chromosome& mother) : void Chromosome::mutate() { - std::uniform_int_distribution<> booldist(0, 1); + std::uniform_int_distribution<> mutatedist(0, 1); // 1/2 of the time, it mutates everytime! std::uniform_int_distribution<> choicedist(0, 12); - while (booldist(*Chromosome::re)) { + while (mutatedist(*Chromosome::re)) { int choice = choicedist(*Chromosome::re); if (choice < 1) { // add