Remove some not used namespace declarations.
[genetic.git] / include / generator / generator.h
index 64f2720820530fadb84d1b1fabc94deb76598864..b9e5680757a648f7d4d87c2585b55aef0c55e89c 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef __GENERATOR_GENERATOR_H
 #define __GENERATOR_GENERATOR_H
 
+#include <ctime>
 #include <cstdlib>
 
 #include "../gene.h"
@@ -25,12 +26,12 @@ namespace genetic {
             /**
              * Size of the generation to generate
              */
-            unsigned int generationSize;
+            const unsigned int generationSize;
 
             /**
              * Size of the chromosome to generate
              */
-            unsigned int chromosomeSize;
+            const unsigned int chromosomeSize;
 
             /**
              * Breeding calculations should be done here...
@@ -46,9 +47,8 @@ namespace genetic {
              * @param generationSize Indicates size of the generation
              * @param chromosomeSize Indicates size of the chromosome
              */
-            Generator(unsigned int generationSize, unsigned int chromosomeSize) {
-                this->generationSize = generationSize;
-                this->chromosomeSize = chromosomeSize;
+            Generator(const unsigned int generationSize, const unsigned int chromosomeSize)
+                : generationSize(generationSize), chromosomeSize(chromosomeSize) {
 
                 time_t t;
                 srand((unsigned)time(&t));