aboutsummaryrefslogtreecommitdiff
path: root/include/HyperNeat/NoveltyMetric.hpp
blob: 01a6f750780fed1a5b018fb2429a8962568932c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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