-
Notifications
You must be signed in to change notification settings - Fork 9
/
Neuron.h
77 lines (68 loc) · 1.83 KB
/
Neuron.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef NEURON_H
#define NEURON_H
#include "Axon.h"
#include "Reservoir.h"
#include "utils.h"
#include "global.h"
#include <vector>
class Axon;
class Reservoir;
class Neuron
{
public:
/** Default constructor */
Neuron();
Neuron(int x, int y, int z);
Neuron(int x, int y, int z, float cue, Reservoir* res);
void addConnection(Neuron* source);
void removeConnection(Neuron* source);
virtual void acceptSignal(float value, Neuron* source);
float process();
bool activatePotential(float value);
void changeCue(float value);
void setCue(float value);
bool equals (Neuron* other);
void makeOutput(bool value);
void resetTrigger();
void resetDendrites();
int getX();
int getY();
int getZ();
Axon* getAxon();
Neuron* getConnection(int index);
int getConnSize();
float getCue();
bool isAlive();
bool isOutput();
bool isTriggered();
inline Reservoir* getRes() {
return res;
};
void printPosition();
/** Default destructor */
virtual ~Neuron();
protected:
private:
int maxInputs;
int maxAxonLength;
int maxSynapses;
/**
* @brief Describes the attractive/repulsive cue this neuron possesses.
*/
float cue;
bool output;
bool alive;
bool triggered; // Used for checking Motor Neurons.
int position[3];
float dendrites[MAX_INPUTS];
int numDendritesActive;
int threshold;
int recoveryPeriod;
int recoveryThreshold;
Axon* axon;
Reservoir* res;
std::vector<Neuron*> connection;
int numConnections;
std::vector<int> counter;
};
#endif // NEURON_H