diff options
author | Jan Huwald <jh@sotun.de> | 2012-05-07 19:53:27 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2012-05-07 19:53:27 (GMT) |
commit | 00b209240138660db1ded3ef3870023964ce6e4e (patch) | |
tree | 8ffaec780b060bdc478929aa714b8af2ee760671 /code/core/synapse.h |
Diffstat (limited to 'code/core/synapse.h')
-rw-r--r-- | code/core/synapse.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/code/core/synapse.h b/code/core/synapse.h new file mode 100644 index 0000000..3eef12d --- /dev/null +++ b/code/core/synapse.h @@ -0,0 +1,48 @@ +#ifndef SYNAPSE_H +#define SYNAPSE_H + +#include <boost/intrusive/slist.hpp> + +using namespace boost::intrusive; + +class Neuron; + +class Synapse { +public: + Synapse(); + + // functions + void computePostsynapticPulse(double &time, double ¤t); // given an input time and current calculate their output value + void evolve(double time); + void stdp(double dt); + static void updateTopology(); // recreate all sin/sout lists in the neurons + + // reflection + template<class Action> bool reflect(Action &a); + typedef int id_type; + static id_type numElements(); + static Synapse * singleton(id_type num); // return neuron # num + static id_type numSynapses; + + // model specifics + int src, dst; // pre- and postsynaptic neuron + double weight; // [V] + double eligibility; // [?] + double delay; // total delay from presynaptic axon hillock to postsynaptic axon hillock + bool constant; // if the weight can change (HINT: weight < 0 implies constness, too) + + // sim helper vars + double firstSpike, // time the first/last spike arrived at it's dst neuron in a given interval + lastSpike; // HINT: firstSpike is set to -INFINITY every time after it is processed + // by the STDP rule + double evolvedUntil; // up to wich time has the model been evolved + + // hock to use intrusive lists (defined in neuron.h) + slist_member_hook<> hook_src, hook_dst; +}; + +const int maxSynapses = 200000; +Synapse syn[maxSynapses]; + + +#endif // SYNAPSE_H |