Big optimizations and securing code.
[genetic.git] / include / mutation / mutation.h
index a35b312b60d637359e7e5d028c79be6bdd5a730e..49b6094649c9bc09b15003df1f89593846746d51 100644 (file)
@@ -19,7 +19,7 @@ namespace genetic {
             /**
              * Type of probability of mutation chance
              */
-            typedef double MutationChanceType;
+            typedef float MutationChanceType;
 
             /**
              * Type representing Chromosome Gene
@@ -37,7 +37,7 @@ namespace genetic {
              *
              * @param chance Chance on which Mutation can occur.
              */
-            Mutation(MutationChanceType chance) :
+            Mutation(const MutationChanceType& chance) :
                 chance(chance) {
             }
 
@@ -48,7 +48,7 @@ namespace genetic {
              * @param _generation Generation for which the mutation should be applied
              * @return new Generation of Chromosome's that passed the mutation
              */
-            Generation<_Chromosome> mutate(Generation<_Chromosome> _generation) {
+            Generation<_Chromosome> mutate(Generation<_Chromosome>& _generation) {
                 const unsigned int generationSize = _generation.size();
                 const unsigned int chromosomeSize = _generation[0].size();
                 vector<_Chromosome> newGeneration;