Added example fitness function template.
[genetic.git] / src / fitness / example.h
1 #ifndef __FITNESS_WSTI_H
2 #define __FITNESS_WSTI_H
3
4 #include <cmath>
5
6 #include "../gene.h"
7
8 using namespace std;
9
10 namespace genetic {
11     /**
12      * Just an example Fitness function.
13      */
14     template < typename _Chromosome >
15     class FitnessExample {
16     protected:
17         _Chromosome chromosome;
18     public:
19         FitnessExample(_Chromosome& _chromosome)
20             : chromosome(_chromosome.get()) {
21         }
22
23         /*
24          * Some calculations here...
25          */
26         double calculate() {
27             return 0;
28         }
29     };
30 }
31
32 #endif /* __FITNESS_WSTI_H */