Improve comments and documentation.
[genetic.git] / src / mutation / mutation.h
index 69c23e7fde54c4d47334a806d61299235e71ce15..7b626ba1e63c54e07db72e0b70552191e787c046 100644 (file)
@@ -10,19 +10,44 @@ using namespace std;
 
 namespace genetic {
 //     namespace mutation {
+        /**
+         * Mutations class. Applies mutation on Chromosome's.
+         */
         template < typename _Chromosome>
         class Mutation {
         public:
+            /**
+             * Type of probability of mutation chance
+             */
             typedef double MutationChanceType;
+
+            /**
+             * Type representing Chromosome Gene
+             */
             typedef typename _Chromosome::GeneType GeneType;
         protected:
+            /**
+             * Chance with which mutation can occur.
+             */
             MutationChanceType chance;
 
         public:
+            /**
+             * Class constructor. Initializes class variables.
+             *
+             * @param chance Chance on which Mutation can occur.
+             */
             Mutation(MutationChanceType chance) :
                 chance(chance) {
             }
 
+            /**
+             * Applies with defined probability mutation on the given generation
+             * of Chromosome's.
+             *
+             * @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) {
                 const unsigned int generationSize = _generation.get().size();
                 const unsigned int chromosomeSize = _generation.get()[0].get().size();