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