-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNeuroEvolution.h
52 lines (33 loc) · 948 Bytes
/
NeuroEvolution.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef NEUROEVOLUTION_CLASS_H
#define NEUROEVOLUTION_CLASS_H
#include <vector>
#include "Species.h"
#include "NeuralNetwork.h"
class NeuroEvolution {
private:
// Species Array
std::vector<Species*> speciesArray;
void clearSpecies();
void clearGenomes();
public:
// Genomes Array
std::vector<Genome*> genomes;
float meanAdjustedFitness = 0.0f;
int currentGeneration = 0;
int bestGenomeIndex = -1;
bool SetGenomeFitness( int index, float fitness );
// Initiate a population
void Initiate();
void Initiate( const char* path );
// Mutation
void Mutate();
// Crossover
void CrossOver();
// Speciation
void Speciate();
void SaveGenomesToJSON();
int SpeciesCount();
void SaveBestGenome();
~NeuroEvolution();
};
#endif