5 #include "chromosome.h"
8 using namespace genetic;
11 typedef Gene<int> _Gene;
12 typedef Chromosome<_Gene> _Chromosome;
14 const unsigned int chromosomeSize = 20;
16 std::vector<_Gene> data;
18 for (unsigned int i = 0; i < chromosomeSize; i++) {
19 data.push_back(_Gene(i));
22 _Chromosome chromosome(data);
24 if (chromosome.size() != chromosomeSize) {
25 cout << "Chromosome contained incorrect size after creation\n";
29 for (unsigned int i = 0; i < chromosome.size(); i++) {
30 if (chromosome[i].get() != i) {
31 cout << "Chromosome contained bad data after creation\n";
36 cout << "Chromosome is created correctly\n";