X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=src%2Ffitness%2Ffitness.h;h=a9750341f32271db145a514c42b5d8691a3ae931;hb=5e4a04634f1d31d4c774b44184cf08d3faf4d02a;hp=66263f1bbc82363adfea48830cbccb148c607bfe;hpb=1bef1f38888f19f83083d2f5bc1e1a90bb14291f;p=genetic.git diff --git a/src/fitness/fitness.h b/src/fitness/fitness.h index 66263f1..a975034 100644 --- a/src/fitness/fitness.h +++ b/src/fitness/fitness.h @@ -1,6 +1,9 @@ #ifndef __FITNESS_FITNESS_H #define __FITNESS_FITNESS_H +#include +#include + #include "chromosome.h" namespace genetic { @@ -44,7 +47,7 @@ namespace genetic { * Copy constructor */ Fitness(_Chromosome& _chromosome) - : chromosome(_chromosome.get()) { + : chromosome(_chromosome) { } /** @@ -55,6 +58,22 @@ namespace genetic { _Value calculate() { return this->do_calculate(); } + + /** + * Method used to pass additional arguments needed by the function to + * run correctly. + */ + virtual void parseArguments(std::map) { } + + /** + * Method used to get additional arguments needed by the function to + * run correctly + * + * @return map containing additional arguments, empty if do not use any + */ + virtual std::map getArguments() { + return std::map(); + } }; }