Add copy constructors. Make example working.
[genetic.git] / src / chromosome.h
1 #ifndef __CHROMOSOME_H
2 #define __CHROMOSOME_H
3
4 #include <vector>
5
6 #include <gene.h>
7
8 using namespace std;
9
10 namespace genetic {
11     template < typename _Chromosome >
12     class Chromosome {
13     protected:
14         vector<_Chromosome> genes;
15
16     public:
17         Chromosome() {}
18
19         Chromosome(vector<_Chromosome> genes) {
20             this->genes = genes;
21         }
22
23         /** Copy constructor */
24         Chromosome(const Chromosome& chromosome) : genes(chromosome.get()) {}
25
26         Chromosome& operator=(const Chromosome&){
27             return *this;
28         }
29
30         vector<_Chromosome> get() {
31             return this->genes;
32         }
33     };
34 }
35
36 #endif /* __CHROMOSOME_H */