From: Rafał Długołęcki Date: Sun, 22 Mar 2015 16:44:57 +0000 (+0100) Subject: Added example fitness function template. X-Git-Url: https://git.dlugolecki.net.pl/?p=genetic.git;a=commitdiff_plain;h=1014b8296cc38f408212d385f036cc78e9c66cce Added example fitness function template. --- diff --git a/src/fitness/example.h b/src/fitness/example.h new file mode 100644 index 0000000..46d8907 --- /dev/null +++ b/src/fitness/example.h @@ -0,0 +1,32 @@ +#ifndef __FITNESS_WSTI_H +#define __FITNESS_WSTI_H + +#include + +#include "../gene.h" + +using namespace std; + +namespace genetic { + /** + * Just an example Fitness function. + */ + template < typename _Chromosome > + class FitnessExample { + protected: + _Chromosome chromosome; + public: + FitnessExample(_Chromosome& _chromosome) + : chromosome(_chromosome.get()) { + } + + /* + * Some calculations here... + */ + double calculate() { + return 0; + } + }; +} + +#endif /* __FITNESS_WSTI_H */