-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModel.hpp
70 lines (53 loc) · 1.46 KB
/
Model.hpp
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef MODEL_H
#define MODEL_H
#include <ostream>
#include "CfgFile.hpp"
#include "Rand.hpp"
#include "PPC.hpp"
#include "Individual.hpp"
#include "BitwiseWeights.hpp"
#include "DataCollector.hpp"
#include "CGPModel.hpp"
class DataCollector;
class Model
{
private:
static CfgFile *config;
DataCollector *dc;
//RandomNumberGenerator rng;
Individual **population;
// GEP
PrototypeChromosome **ppc_array;
Neuron **inputs;
Individual* create_pipe_gep_individual( double **weight_arrays, bool with_gm, RandomNumberGenerator& rng );
// CGP
CGPModel cgp_model;
// SHC Weight
SHCWeightCollection **shc_weight_array;
// Bitwise Weight
BitwiseWeights *bitwise_weights;
public:
Model();
~Model();
void init();
void set_data_collector( DataCollector& dc );
static void set_config( CfgFile& cfg );
Neuron** get_inputs();
void init_population();
void delete_population();
void sample( RandomNumberGenerator& rng );
void measure_fitness( ostream& fout );
void adapt( Individual *indiv );
void mutate( RandomNumberGenerator& rng );
bool stop_condition_met();
void print( ostream& fout );
Individual* get_elite();
Individual* get_best();
Individual* get_gm_indiv();
int total_fitness, highest_fitness, lowest_fitness, elite_fitness;
int highest_fitness_index, lowest_fitness_index;
int total_evals;
Individual *elite_individual, *best_individual;
bool is_elitist_learning;
};
#endif