Browse Source

Moved defines to constants in-class

remotes/origin/HEAD
Mike 2 years ago
parent
commit
0326bc4ddf
2 changed files with 7 additions and 7 deletions
  1. +1
    -5
      Defines.h
  2. +6
    -2
      Population.cpp

+ 1
- 5
Defines.h View File

@@ -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




+ 6
- 2
Population.cpp View File

@@ -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…
Cancel
Save