+#ifndef __GENERATOR_GENERATION_H
+#define __GENERATOR_GENERATION_H
+
+#include <vector>
+
+#include "../gene.h"
+#include "../chromosome.h"
+#include "../generation.h"
+
+using namespace std;
+
+namespace genetic {
+ namespace generator {
+ /**
+ * Generator for generating entire Generation of Chromosomes (individuals)
+ */
+ template < typename _Chromosome >
+ class Generation {
+ public:
+ /**
+ * Type of used Genes in Chromosome
+ */
+ typedef typename _Chromosome::GeneType GeneType;
+ protected:
+ /**
+ * Size of the generation to generate
+ */
+ unsigned int generationSize;
+
+ /**
+ * Size of the chromosome to generate
+ */
+ unsigned int chromosomeSize;
+
+ public:
+ /**
+ * Constructor.
+ *
+ * @param generationSize Indicates size of the generation
+ * @param generationSize Indicates size of the chromosome
+ */
+ Generation(unsigned int generationSize, unsigned int chromosomeSize) {
+ this->generationSize = generationSize;
+ this->chromosomeSize = chromosomeSize;
+ }
+
+ /**
+ * Breeds new generation of chromosomes.
+ *
+ * @return ::genetic::Generation Generation of Chromosomes
+ */
+ ::genetic::Generation<_Chromosome> breed() {
+ vector<_Chromosome> chromosomes;
+
+ for (unsigned int i = 0; i < generationSize; i++) {
+ vector<GeneType> genes;
+ for (unsigned int j = 0; j < chromosomeSize; j++) {
+ GeneType gene(rand() % 2);
+ genes.push_back(gene);
+ }
+ chromosomes.push_back(genes);
+ }
+
+ return ::genetic::Generation<_Chromosome>(chromosomes);
+ }
+ };
+ }
+}
+
+#endif /* __GENERATOR_GENERATION_H */