Cleanup code.
[genetic.git] / src / generator / generation.h
index c90a3769081d2978751b1ca989bbe6db5287eb4b..a561d8e818fd941c505617b59ae69fabcbbfdcdf 100644 (file)
@@ -2,6 +2,7 @@
 #define __GENERATOR_GENERATION_H
 
 #include <vector>
+#include <cstdlib>
 
 #include "../gene.h"
 #include "../chromosome.h"
@@ -34,7 +35,7 @@ namespace genetic {
 
         public:
             /**
-             * Constructor.
+             * Constructor. Initializes required variables and constans
              *
              * @param generationSize Indicates size of the generation
              * @param generationSize Indicates size of the chromosome
@@ -42,6 +43,9 @@ namespace genetic {
             Generation(unsigned int generationSize, unsigned int chromosomeSize) {
                 this->generationSize = generationSize;
                 this->chromosomeSize = chromosomeSize;
+
+                time_t t;
+                srand((unsigned)time(&t));
             }
 
             /**