summaryrefslogtreecommitdiff
path: root/code/core/neuron.h
blob: 03c0dbb999e1d76970140d00f03cc41f789cd28c (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*************************************************************
neuron.h
  implementation the axon hillock

  STORES
  * current tuning of neuron body (parameters)
  * list of synapses (-> connections to other neurons)
**************************************************************/

#ifndef NEURON_H
#define NEURON_H

#include <boost/intrusive/slist.hpp>

#include "synapse.h"

using namespace boost::intrusive;

typedef slist<Synapse, member_hook<Synapse, slist_member_hook<>, &Synapse::hook_dst> > SynapseDstList;
typedef slist<Synapse, member_hook<Synapse, slist_member_hook<>, &Synapse::hook_src> > SynapseSrcList;

class Neuron {
public:
  Neuron();
  void init();

  // functions operating on neuronal state
  double evolve(double time);
  double processCurrent(double time, double current);
  double generateSpike(double time, bool &doesOccur);
  double predictSpike(double time);
  void intrinsicPlasticity(double td);

  // reflection
  template<class Action> bool reflect(Action &a);
  typedef int id_type;
  static id_type numElements();
  static Neuron * singleton(int num); // return neuron # num

  // list of outgoing and incoming synapses
  SynapseSrcList sin;
  SynapseDstList sout;
  //Synapse **sin, *sout;// list of _in_coming and _out_going _s_ynapses; HINT: sin is a list of pointers to synapses in the corresponding outgoing neuron

  // basic neuron properties
  double voltage; // [V]
  double refractoryTime; // [s]

  // IP related
  bool ip; // if this neuron has IP at all
  double ip_est_mom1, ip_est_mom2; // estimated moments (using exponential sliding average (exact integration))
  double ip_dst_mom1, ip_dst_mom2; // targeted moments
  double ip_R, ip_C; // internal correspondences to christinas model
  double fac_voltage_tau, fac_current; // resulting coefficients for neuron behaviour

  // local clocks
  double lastEvent; // timepoint when the last event occured
  double lastSpike;
};

const int numNeurons = 1000;
Neuron n[numNeurons];

#endif // NEURON_H
contact: Jan Huwald // Impressum