-
Notifications
You must be signed in to change notification settings - Fork 0
/
GEPNN.hpp
69 lines (54 loc) · 1.31 KB
/
GEPNN.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
#ifndef GEPNN_H
#define GEPNN_H
#include "GEPNet.hpp"
#include <iostream>
#include <fstream>
class GepNN
{
private:
short **genes;
double *weights;
bool *weights_used;
void deleteGenes();
short min_arity;
short max_arity;
short head_length;
short tail_length;
short wd_length;
int number_of_network_inputs;
short num_weights;
short num_genes;
short num_functions;
short *offset;
GEPNet *net;
void initOffset();
int getNeuronNumberOfInputs( char char_gene );
public:
GepNN( short num_genes,
short head_length,
short min_arity,
short max_arity,
short num_inputs,
short num_weights );
GepNN( GepNN *cpy );
~GepNN();
void setHeadLength( short hl );
void setWeights( double *weights, short len ); // WEIGHTS ARE COPIED
double* getWeights();
bool* getWeightsUsed();
void setGene( short i, short *gene );
void setGene( short index, char *gene );
short* getGene( short i );
char* getGeneString();
static char getNeuronType( short n );
char getCharGene( short n, bool wd = false );
GEPNet* createNetwork( Neuron **inputs );
int getOffset( short gene );
void setGeneElem( short gene, short elem, short nvalue );
void setWeight( short w, double nvalue );
int getSize();
int fitness;
void print( std::ostream &fout );
short gene_length;
};
#endif