summaryrefslogtreecommitdiff
path: root/code/core/synapse.h
blob: 3eef12dd4fb9bf1560335a092a991b2394d50524 (plain)
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
#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 &current); // 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
contact: Jan Huwald // Impressum