Fix building and installing package.
[genetic.git] / include / fitness / example.h
diff --git a/include/fitness/example.h b/include/fitness/example.h
new file mode 100644 (file)
index 0000000..522b9d3
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef __FITNESS_WSTI_H
+#define __FITNESS_WSTI_H
+
+#include <cmath>
+
+#include "../gene.h"
+
+using namespace std;
+
+namespace genetic {
+    /**
+     * Just an example Fitness function.
+     */
+    template <typename _Chromosome, typename _Value = double>
+    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 */