aboutsummaryrefslogtreecommitdiff
path: root/include/HyperNeat/Genome.hpp
blob: d8f678f5032b4aeea85f459d3e3d6eeaf982d898 (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
38
39
40
41
42
#ifndef __HYPERNEAT_GENOME_HPP__
#define __HYPERNEAT_GENOME_HPP__

#include <HyperNeat/Utils/Map.hpp>
#include <HyperNeat/Utils/Size.hpp>
#include <HyperNeat/Utils/NodeTypes.hpp>

namespace hyperneat
{
    class Genome
    {
    public:
        Genome() = default;
        explicit Genome(size_t inputs);

        class NodeGene
        {
        public:
            NodeGene() = default;
            NodeGene(double depth, NodeType nodeType);

            class LinkGene
            {
            public:
                LinkGene() = default;
                LinkGene(double weight, bool isEnabled = true);

                double _weight    = 0.0;
                bool   _isEnabled = true;
            };

            double                _depth    = 0.0;
            NodeType              _nodeType = NodeType::NULL_TYPE;
            Map<size_t, LinkGene> _linkGenes;
        };

        size_t                _inputs = 0;
        Map<size_t, NodeGene> _nodeGenes;
    };
}

#endif