#ifndef __FITNESS_FITNESS_H
#define __FITNESS_FITNESS_H
-#include "../chromosome.h"
+#include "chromosome.h"
namespace genetic {
/**
*/
template < typename _Chromosome, typename _Value = double >
class Fitness {
- template<typename> friend class Selection ;
+ template<typename> friend class Selection;
public:
+ /**
+ * Type representing Chromosome Gene
+ */
typedef typename _Chromosome::GeneType GeneType;
+
+ /**
+ * Value type returned by the Fitness function
+ */
typedef _Value ValueType;
protected:
+ /**
+ * Chromosome on which calculations are made
+ */
_Chromosome chromosome;
- /*
- * Some calculations here...
+ /**
+ * Calculations should be done here...
+ *
+ * @return Fitness value of the current Chromosome
*/
virtual _Value do_calculate() = 0;
public:
+ /**
+ * Class constructor
+ */
Fitness() {}
+ /**
+ * Copy constructor
+ */
Fitness(_Chromosome& _chromosome)
: chromosome(_chromosome.get()) {
}
+ /**
+ * Invokes calculations
+ *
+ * @return Fitness value of the current Chromosome
+ */
_Value calculate() {
return this->do_calculate();
}