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);
23 _Chromosome chromosome2;
25 chromosome2 = chromosome;
27 if (chromosome2.size() != chromosomeSize) {
28 cout << "Chromosome contained incorrect size after copying\n";
32 for (unsigned int i = 0; i < chromosome2.size(); i++) {
33 if (chromosome2[i].get() != i) {
34 cout << "Chromosome contained bad data after copying\n";
39 cout << "Chromosome copies data correctly\n";