-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathSynapse.h
46 lines (37 loc) · 977 Bytes
/
Synapse.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
#ifndef SYNAPSE_H
#define SYNAPSE_H
#include "Neuron.h"
#include "global.h"
#include "utils.h"
class Neuron;
class Synapse
{
public:
/** Default constructor */
Synapse();
Synapse(Neuron* target, Neuron* origin);
Synapse(float weight, Neuron* target, Neuron* origin);
void trigger(float value, bool train);
Neuron* getTarget();
void setTarget(Neuron* target);
Synapse* getNext();
void setNext(Synapse* next);
void depreciate(float value);
void changeWeight(float value);
void changeLifespan(float lifespan);
void makePerm();
float getWeight();
float getLifespan();
/** Default destructor */
virtual ~Synapse();
void deleteAll();
protected:
private:
float weight;
float lifespan;
bool permanent;
Neuron* target;
Synapse* next;
Neuron* origin;
};
#endif // SYNAPSE_H