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 */