Fixed Mutation.
[genetic.git] / src / gene.h
1 #ifndef __GENE_H
2 #define __GENE_H
3
4 namespace genetic {
5
6     /**
7      * Gene.
8      */
9     template < typename Type >
10     class Gene {
11     protected:
12         Type value;
13     public:
14         Gene() {}
15
16         Gene(Type value) {
17             this->value = value;
18         }
19
20         /** Copy constructor */
21         Gene(const Gene& gene) : value(gene.get()) {}
22
23         Gene& operator=(const Gene& gene) {
24             this->value = gene.get();
25             return *this;
26         }
27
28         Type get() const {
29             return value;
30         }
31     };
32 }
33
34 #endif /* __GENE_H */