5 #include "chromosome.h"
6 #include "generation.h"
7 #include "generator/bitGenerator.h"
8 #include "condition/generationLimitCondition.h"
11 using namespace genetic;
14 typedef Gene<int> _Gene;
15 typedef Chromosome<_Gene> _Chromosome;
16 typedef Generation<_Chromosome> _Generation;
17 typedef generator::BitGenerator<_Chromosome> _Generator;
18 typedef GenerationLimitCondition<_Chromosome> _Condition;
20 const unsigned int chromosomeSize = 20;
21 const unsigned int generationSize = 100;
22 const unsigned int numberOfChecks = 20;
24 _Generator generator(generationSize, chromosomeSize);
25 _Generation generation = generator.breed();
26 _Condition condition(numberOfChecks);
29 while(condition.check(generation)) {
30 if (i > numberOfChecks) {
31 cout << "GenerationLimitCondition got outside limit\n";
37 cout << "BitGenerator breeded correctly\n";