LoveBrains  1.0.0
gann_engine.h
1 /*
2 ** gann.h for GANNEngine in /home/robin_f/Programming/Git/CPP/GANNEngine
3 **
4 ** Made by Guillaume ROBIN
5 ** Login <robin_f@epitech.eu>
6 **
7 ** Started on Wed Jul 8 19:53:34 2015 Guillaume ROBIN
8 ** Last update Fri Aug 21 23:06:25 2015 Guillaume ROBIN
9 */
10 
11 #ifndef GANN_ENGINE_H_
12 # define GANN_ENGINE_H_
13 
14 # include "GA/ga_engine.h"
15 # include "GANN/gann_exception.h"
16 # include "GANN/gann.h"
17 
18 namespace GANN
19 {
24  class GANNEngine
25  {
26  public:
30  GANNEngine(void) throw();
35  ~GANNEngine(void);
36 
37  /*
38  ** Initializer.
39  */
40 
47  void Init(GA::GAConfig const& config, unsigned int size);
48 
49  /*
50  ** Getters.
51  */
52 
58  ANN const& getBestANN(void) const;
63  GA::GAEngine& getGAEngine(void) throw();
68  GA::GAEngine const& getGAEngine(void) const throw();
73  GA::GAConfig const& getGAConfig(void) const throw();
74 
75  /*
76  ** Setters.
77  */
78 
83  void setGAConfig(GA::GAConfig const& config);
84 
85  /*
86  ** Methods.
87  */
88 
94  void StartSimulation(bool report);
95 
96  private:
97  /*
98  ** GA Parameters.
99  */
100  unsigned int _pool_size;
101  double _mutation_rate;
102  double _selection_rate;
104  GA::GAEngine _engine;
105  GA::GAConfig _config;
107  /*
108  ** GA Functions.
109  */
110 
117  static bool ANNComparator(const GA::IDNA *, const GA::IDNA *);
123  static GA::IDNA *ANNCrossover(const GA::IDNA *, const GA::IDNA *);
128  static void ANNMutation(GA::IDNA *);
129  };
130 }
131 
132 #endif /* !GANN_ENGINE_H_ */
GANNEngine(void)
Constructor.
Definition: gann_engine.cc:24
void setGAConfig(GA::GAConfig const &config)
Set the GA::GAEngine configuration.
Definition: gann_engine.cc:103
void StartSimulation(bool report)
Start the simulation with the aim of evolving the population.
Definition: gann_engine.cc:157
Define the interface that will be used to create an supported individual for the GAEngine.
Definition: i_dna.h:22
GA::GAConfig const & getGAConfig(void) const
Get the GA::GAConfig member.
Definition: gann_engine.cc:95
Define the engine that will manage the population of GANN and the evolution.
Definition: gann_engine.h:24
void Init(GA::GAConfig const &config, unsigned int size)
Initialize the GANNEngine.
Definition: gann_engine.cc:40
GA::GAEngine & getGAEngine(void)
Get the GA::GAEngine member.
Definition: gann_engine.cc:85
Manage the evolution of a population composed of IDNA objects.
Definition: ga_engine.h:24
Define the configuration of the GAEngine.
Definition: ga_config.h:24
Define what is a neural network.
Definition: neural_net.h:24
Contains all the objects that provide the management for the genetic algorithm with neural networks...
Definition: ann_exception.h:16
~GANNEngine(void)
Destructor.
Definition: gann_engine.cc:33
ANN const & getBestANN(void) const
Get the best neural network contained in the population.
Definition: gann_engine.cc:61