12 * Chromosome of given Genes.
14 template < typename _Gene >
18 * Type representing Chromosome Gene
20 typedef _Gene GeneType;
23 * Genes of the chromosome
27 template<typename> friend class Chromosome;
35 * Class constructor. Initializes Chromosome with the given Gene's
37 * @param genes vector containing Genes to use in Chromosome
39 Chromosome(vector<_Gene> genes) {
43 /** Copy constructor */
44 Chromosome(const Chromosome& chromosome)
45 : genes(chromosome.genes) {
51 * @param chromosome Chromosome from which the Genes should be copied.
52 * @return Chromosome instance containing copied Genes
54 Chromosome& operator=(const Chromosome& chromosome) {
55 this->genes = chromosome.genes;
60 * Returns number of Genes in current Chromosome
62 * @return number of Genes in current Chromosome
64 unsigned int size() const {
65 return this->genes.size();
69 * Returns i-th Gene in the current Chromosome
71 * @return i-th Gene in the current Chromosome
73 _Gene& operator[](unsigned int i) {
74 return this->genes[i];
79 #endif /* __CHROMOSOME_H */