Moved defines to constants in-class
This commit is contained in:
parent
b0da515139
commit
0326bc4ddf
@ -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
|
||||
|
||||
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user