From 0326bc4ddf3213520625cd8830515d28831f9fa0 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 14 Apr 2018 01:08:22 -0700 Subject: [PATCH] Moved defines to constants in-class --- Defines.h | 6 +----- Population.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Defines.h b/Defines.h index 61a3ba4..bbfde70 100644 --- a/Defines.h +++ b/Defines.h @@ -2,11 +2,7 @@ #define BITEVOLVER_DEFINES_H - -// -#define BIT_EVOLVER_POPULATION_DEFAULT_POPULATION_SIZE 100 -#define BIT_EVOLVER_POPULATION_DEFAULT_MUTATE_RATE 0.01 -#define BIT_EVOLVER_POPULATION_DEFAULT_CROSSOVER 0.7 +// Nada for now diff --git a/Population.cpp b/Population.cpp index 31dfb91..5b5ea1c 100644 --- a/Population.cpp +++ b/Population.cpp @@ -39,9 +39,13 @@ namespace BitEvolver void Population::Reset() { // - this->population_size = BIT_EVOLVER_POPULATION_DEFAULT_POPULATION_SIZE; - this->SetMutationRate(BIT_EVOLVER_POPULATION_DEFAULT_MUTATE_RATE); this->evolution_number = 0; + this->population_size = Population::DEFAULT_POPULATION_SIZE; + + // + this->SetCrossoverType(Population::DEFAULT_CROSSOVER_TYPE); + this->SetCrossoverPoint(Population::DEFAULT_CROSSOVER_POINT); + this->SetMutationRate(Population::DEFAULT_MUTATION_RATE); // this->RandomizePopulation(this->population_size);