Improve comments and documentation.
[genetic.git] / src / generation.h
index 39b9577bc4f7c855da8acdb0c2413de7dffe5721..a37602897694cc6d5afabf80d59331ff74fadca5 100644 (file)
@@ -10,16 +10,27 @@ using namespace std;
 
 namespace genetic {
     /**
-     * Generation of given Chromosomes.
+     * Class representing Generation of given Chromosomes.
      */
     template < typename _Chromosome >
     class Generation {
     protected:
+        /**
+         * Chromosomes in the given Generation
+         */
         vector<_Chromosome> chromosomes;
 
     public:
+        /**
+         * Default constructor
+         */
         Generation() {}
 
+        /**
+         * Class constructor. Initializes generation with the given chromosomes
+         *
+         * @param chromosomes vector containing Chromosomes to use in Generation
+         */
         Generation(vector<_Chromosome> chromosomes) {
             this->chromosomes = chromosomes;
         }
@@ -29,10 +40,19 @@ namespace genetic {
             : chromosomes(generation.get()) {
         }
 
+        /**
+         * Allows read-only access to Generation Chromosomes
+         */
         vector<_Chromosome> get() const {
             return this->chromosomes;
         }
 
+        /**
+         * Copy operator.
+         *
+         * @param generation Generation from which the Chromosomes should be copied.
+         * @return Generation instance containing copied Chromosomes
+         */
         Generation& operator=(const Generation& generation){
             this->chromosomes = generation.get();
             return *this;