X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=include%2Ffitness%2Fexample.h;fp=include%2Ffitness%2Fexample.h;h=522b9d30c0675d2b6212d2da3922c1db8bb2085b;hb=2a8fc81203107eb3495a50fb2666803fda3e0517;hp=0000000000000000000000000000000000000000;hpb=169219566d08e4940d25b66ecdb68e80b90c090d;p=genetic.git diff --git a/include/fitness/example.h b/include/fitness/example.h new file mode 100644 index 0000000..522b9d3 --- /dev/null +++ b/include/fitness/example.h @@ -0,0 +1,38 @@ +#ifndef __FITNESS_WSTI_H +#define __FITNESS_WSTI_H + +#include + +#include "../gene.h" + +using namespace std; + +namespace genetic { + /** + * Just an example Fitness function. + */ + template + class FitnessExample : public Fitness<_Chromosome, _Value> { + protected: + /* + * Chromosome is inherited so you don't have to declare usage of one + */ + /* _Chromosome chromosome; */ + public: + /** + * Example class constructor + */ + FitnessExample(_Chromosome& _chromosome) + : Fitness<_Chromosome>(_chromosome) { + } + + /** + * Some calculations should be passed here... + */ + double calculate() { + return 0; + } + }; +} + +#endif /* __FITNESS_WSTI_H */