Finished Roulette Selection.
[genetic.git] / src / gene.h
index ddd8c7124c2c051d5555baeb01b1fb9e2e25ccac..9786587d3d5409cf1ed0ab0a2e7996a495c600de 100644 (file)
@@ -3,19 +3,31 @@
 
 namespace genetic {
 
+    /**
+     * Gene.
+     */
     template < typename Type >
     class Gene {
     protected:
-        Type type;
+        Type value;
     public:
-        Gene(Type type) {
-            this->type = type;
+        Gene() {}
+
+        Gene(Type value) {
+            this->value = value;
+        }
+
+        /** Copy constructor */
+        Gene(const Gene& gene) : value(gene.get()) {}
+
+        Gene& operator=(const Gene&){
+            return *this;
         }
 
-        Type get() {
-            return this->type;
+        Type get() const {
+            return value;
         }
     };
 }
 
-#endif /* __GENE_H */
\ No newline at end of file
+#endif /* __GENE_H */