summaryrefslogtreecommitdiff
path: root/core/all_spikes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/all_spikes.cpp')
-rw-r--r--core/all_spikes.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/core/all_spikes.cpp b/core/all_spikes.cpp
new file mode 100644
index 0000000..5307e8b
--- /dev/null
+++ b/core/all_spikes.cpp
@@ -0,0 +1,49 @@
+#include <assert.h>
+#include <errno.h>
+#include <iostream>
+#include <stdlib.h>
+
+#include "everything_else.hpp"
+#include "index.hpp"
+#include "index_spike.hpp"
+#include "index_randomspike.hpp"
+
+#include "mempool.hpp"
+
+using namespace std;
+
+int main(int argc, char **argv) {
+ // read cmd line params
+ assert(argc == 3);
+
+ errno = 0;
+ char *tail;
+ Time start(strtod( argv[1], &tail)); assert(*tail == 0);
+ Time stop( strtod( argv[2], &tail)); assert(*tail == 0);
+ assert(errno == 0);
+
+ assertSimDir();
+
+ {
+ // go to first spike with time >= start
+ // Index<RandomSpike> idx;
+ // Ptr<RandomSpike>::ptr_t cur(idx.first(start));
+ Index<Spike> idx;
+ Ptr<Spike>::ptr_t cur(idx.first(start));
+
+ // no spike found?
+ if (cur == idx.nil())
+ return 0;
+
+ // output
+ cout << "# time\tneuron" << endl;
+ while (cur <= idx.last() && idx.time(cur) <= stop) {
+ if (idx.src(cur) < numActualNeurons) // don't plot pseudo neurons
+ // cout << idx.eventTime(cur) << "\t" << idx.src(cur) << endl;
+ cout << idx.time(cur) << "\t" << idx.src(cur) << endl;
+ ++cur;
+ }
+ }
+
+ return 0;
+}
contact: Jan Huwald // Impressum