aboutsummaryrefslogtreecommitdiff
path: root/NodeLayer.hpp
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 03:15:03 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 03:15:30 +0100
commit6fd23da97fa9700f59c61a966b4bf7d25fa46b34 (patch)
treed5fe3a8305a5f57e5b4cedc8300e951c74696cc5 /NodeLayer.hpp
initial commitHEADmaster
Diffstat (limited to 'NodeLayer.hpp')
-rw-r--r--NodeLayer.hpp30
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__