Made Algorithm functions more generic.
[genetic.git] / src / fitness / fitness.h
index 66263f1bbc82363adfea48830cbccb148c607bfe..093490d367e1fa7add12bb9164cb62f9c1d0ee39 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef __FITNESS_FITNESS_H
 #define __FITNESS_FITNESS_H
 
+#include <map>
+#include <string>
+
 #include "chromosome.h"
 
 namespace genetic {
@@ -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<string, string>) { }
+
+        /**
+         * 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<string, string> getArguments() {
+            return std::map<string, string>();
+        }
     };
 }