diff options
author | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 03:15:03 +0100 |
---|---|---|
committer | Paul Oliver <contact@pauloliver.dev> | 2024-02-29 03:15:30 +0100 |
commit | 6fd23da97fa9700f59c61a966b4bf7d25fa46b34 (patch) | |
tree | d5fe3a8305a5f57e5b4cedc8300e951c74696cc5 /NodeLayer.hpp |
Diffstat (limited to 'NodeLayer.hpp')
-rw-r--r-- | NodeLayer.hpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/NodeLayer.hpp b/NodeLayer.hpp new file mode 100644 index 0000000..8ff44c2 --- /dev/null +++ b/NodeLayer.hpp @@ -0,0 +1,30 @@ +#ifndef __NODELAYER_HPP__ +#define __NODELAYER_HPP__ + +#include "Neuron.hpp" +#include "MemCell.hpp" + +class NodeLayer +{ +public: + NodeLayer(unsigned inputCount, unsigned nodeCount, NodeClass nodeClass, bool zeroed = false); + + void setChromosome(const Chromosome &chromosome); + Chromosome getChromosome() const; + unsigned getChromosomeSize() const; + + std::vector<float> io(const std::vector<float> &inputs); + + unsigned getInputCount() const { return m_inputCount; } + unsigned getNodeCount() const { return m_nodeCount; } + NodeClass getNodeClass() const { return m_nodeClass; } + +private: + unsigned m_inputCount = 0; + unsigned m_nodeCount = 0; + NodeClass m_nodeClass; + + std::vector<std::unique_ptr<Node>> m_nodes; +}; + +#endif // __NODELAYER_HPP__ |