summaryrefslogtreecommitdiff
path: root/code/core/spike.h
diff options
context:
space:
mode:
Diffstat (limited to 'code/core/spike.h')
-rw-r--r--code/core/spike.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/code/core/spike.h b/code/core/spike.h
new file mode 100644
index 0000000..2b2e4da
--- /dev/null
+++ b/code/core/spike.h
@@ -0,0 +1,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