Created initial Gene and Chromosome. Added initial test for Gene.
[genetic.git] / src / main.cpp
1 #include <iostream>
2 #include <vector>
3
4 #include <cstdlib>
5
6 #include "gene.h"
7 #include "chromosome.h"
8
9 using namespace std;
10 using namespace genetic;
11
12 int main() {
13     typedef Gene<int> _Gene;
14
15     time_t t;
16     srand((unsigned)time(&t));
17
18     vector<_Gene> genes;
19
20     for (int i = 0; i < 20; i++) {
21         _Gene gene(rand() % 255);
22         cout << "Generated gene: " << gene.get() << "\n";
23         genes.push_back(gene);
24     }
25     Chromosome<_Gene> chromosome(genes);
26
27     return 0;
28 }