summaryrefslogtreecommitdiff
path: root/code/core/global.h
blob: 8fec3d4bd90f3857c15ceb583668a5781b442946 (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
#ifndef GLOBAL_H
#define GLOBAL_H

class Global {
public:
  Global();

  // methods
  void evolve(double td);
  double decay_dopamin(double level, double td); // return how much the level _would_ have been decayed

  // variables (and quasi constants)
  //   * neuron related
  double voltage_tau;  // [s]
  double voltage_base; // [V] rest potential 
  double threshold;    // [V] above which a spike is emitted

  double Wmax, Wmin;   // [V]
  double sumWeight;    // [V]
  double absoluteRefractoryTime; // [V]

  //   * dopamin
  double dopamin_level; // [?]
  double dopamin_tau;   // [s]

  //   * STDP
  double stdp_tau_plus;     // [s]
  double stdp_tau_minus;    // [s]
  double stdp_lambda_plus;  // [1]
  double stdp_lambda_minus; // [1]
  double stdp_et_tau;       // [s] eligibility trace tau

  //   * IP
  double ip_sliding_avg_tau;
  double ip_lambda_R;
  double ip_lambda_C;
  double ip_dst_mom1;
  double ip_dst_mom2;

  //   * external noise
  double en_current; // [V]
  double en_freq; // [Hz/Neuron]

  //   * trainer
  double trainer_eval_delay; // [s]
  int trainer_numSymbols;            // [1]
  double trainer_refractoryTime;     // [s]
  double trainer_rewardAmount;       // [?]
  double trainer_rd_c1; // readout delay with
  double trainer_rd_c2; //   delay = c1 + t*c2 + r*c3 + t*r'*c4
  double trainer_rd_c3; // where
  double trainer_rd_c4; //   r and r' are two distinct random numbers (equ. dist in [0,1))

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

Global &g = global;

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