summaryrefslogtreecommitdiff
path: root/code/core/spike.h
blob: 2b2e4da68e522cf153af39c4920cf61c240e8d49 (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
#ifndef SPIKE_H
#define SPIKE_H

#include <math.h>

#include "neuron.h"
#include "log.h"

class SpikeMUX {
public:
  typedef Neuron::id_type id_type; // WARN: this id refers to the spiking neuron, not the spike itself wich can not be addressed directly
  SpikeMUX(id_type dst) : dst(dst), time(-INFINITY), current(0.0) {}
  SpikeMUX(id_type dst, double time) : dst(dst), time(time), current(0.0) {}

  // reflection
  template<class Action> bool reflect(Action &a);
  static id_type numElements() { DIE("Spike::numElements() called"); }
  static SpikeMUX * singleton(id_type num); // do some reflection magic to multiplex between IntrinsicNeuron and ExternalNoise

  // properties
  id_type dst;
  double time;
  double current;
};

SpikeMUX staticSpikeMUX(-1); // single copy to use for reading spikes

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