Moved defines to constants in-class

This commit is contained in:
Mike 2018-04-14 01:08:22 -07:00
parent b0da515139
commit 0326bc4ddf
2 changed files with 7 additions and 7 deletions

View File

@ -2,11 +2,7 @@
#define BITEVOLVER_DEFINES_H #define BITEVOLVER_DEFINES_H
// Nada for now
//
#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

View File

@ -39,9 +39,13 @@ namespace BitEvolver
void Population::Reset() 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->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); this->RandomizePopulation(this->population_size);