-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgene.h
47 lines (31 loc) · 1.13 KB
/
gene.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
#ifndef _GENE_H_
#define _GENE_H_
#include "neat.h"
#include "trait.h"
#include "link.h"
#include "network.h"
namespace NEAT {
class Gene {
public:
Link *lnk;
double innovation_num = 0;
double mutation_num = 0; //Used to see how much mutation has changed the link
bool enable = false; //When this is off the Gene is disabled
bool frozen = false; //When frozen, the linkweight cannot be mutated
//Construct a gene with no trait
Gene(double w,NNode *inode,NNode *onode,bool recur,double innov,double mnum);
//Construct a gene with a trait
Gene(Trait *tp,double w,NNode *inode,NNode *onode,bool recur,double innov,double mnum);
//Construct a gene off of another gene as a duplicate
Gene(Gene *g,Trait *tp,NNode *inode,NNode *onode);
//Construct a gene from a file spec given traits and nodes
Gene(const char *argline, std::vector<Trait*> &traits, std::vector<NNode*> &nodes);
// Copy Constructor
Gene(const Gene& gene);
~Gene();
//Print gene to a file- called from Genome
void print_to_file(std::ostream &outFile);
void print_to_file(std::ofstream &outFile);
};
} // namespace NEAT
#endif