diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 19:04:34 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 19:16:14 +0100 |
commit | e6ab4a8ed100d5d5b7611c74cf3ccd556f1f1d71 (patch) | |
tree | 129cf13c2f9b3eae54402300db4570815789a02a /include/HyperNeat/NoveltyMetric.hpp |
Diffstat (limited to 'include/HyperNeat/NoveltyMetric.hpp')
-rw-r--r-- | include/HyperNeat/NoveltyMetric.hpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/HyperNeat/NoveltyMetric.hpp b/include/HyperNeat/NoveltyMetric.hpp new file mode 100644 index 0000000..01a6f75 --- /dev/null +++ b/include/HyperNeat/NoveltyMetric.hpp @@ -0,0 +1,37 @@ +#ifndef __HYPERNEAT_NOVELTY_METRIC_HPP__ +#define __HYPERNEAT_NOVELTY_METRIC_HPP__ + +#include <Hyperneat/Behavior.hpp> +#include <Hyperneat/Utils/Vector2D.hpp> +#include <Hyperneat/NoveltyMetricPrms.hpp> + +namespace hyperneat +{ + class Population; + + class NoveltyMetric + { + public: + const NoveltyMetricPrms& getPrms() const; + const Vector<Behavior>& getBehaviors() const; + const Vector2D<double>& getArchive() const; + + Behavior& getBehaviorOf(size_t i); + + private: + void initialize(const NoveltyMetricPrms& prms, Population* population = nullptr); + void setScores(); + + double getDistance(const Vector<double>& v1, const Vector<double>& v2) const; + + NoveltyMetricPrms _prms; + Vector<Behavior> _behaviors; + Vector2D<double> _archive; + + friend class Behavior; + friend class LoadFile; + friend class Population; + }; +} + +#endif |