7 #include <chromosome.h>
13 * Class representing Generation of given Chromosomes.
15 template < typename _Chromosome >
19 * Chromosomes in the given Generation
21 vector<_Chromosome> chromosomes;
30 * Class constructor. Initializes generation with the given chromosomes
32 * @param chromosomes vector containing Chromosomes to use in Generation
34 Generation(vector<_Chromosome> chromosomes) {
35 this->chromosomes = chromosomes;
38 /** Copy constructor */
39 Generation(const Generation& generation)
40 : chromosomes(generation.get()) {
44 * Allows read-only access to Generation Chromosomes
46 vector<_Chromosome> get() const {
47 return this->chromosomes;
53 * @param generation Generation from which the Chromosomes should be copied.
54 * @return Generation instance containing copied Chromosomes
56 Generation& operator=(const Generation& generation){
57 this->chromosomes = generation.get();
63 #endif /* __GENERATION_H */