summaryrefslogtreecommitdiff
path: root/code/core/simulate.h
diff options
context:
space:
mode:
Diffstat (limited to 'code/core/simulate.h')
-rw-r--r--code/core/simulate.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/code/core/simulate.h b/code/core/simulate.h
new file mode 100644
index 0000000..3d84b6e
--- /dev/null
+++ b/code/core/simulate.h
@@ -0,0 +1,70 @@
+#ifndef SIMULATE_H
+#define SIMULATE_H
+
+#include <queue>
+#include <list>
+
+#include "neuron.h"
+#include "synapse.h"
+#include "tracepoints.h"
+#include "event.h"
+#include "interface.h"
+#include "spike.h"
+
+using namespace std;
+
+class Simulation {
+public:
+ Simulation();
+
+ // ----- FUNCTIONS -----
+
+ // controlling functions
+ bool Step(); // do a single step (fire one neuron); return if the net is dead
+ bool proceedTime(double td);
+ bool proceedSpikes(long count);
+
+ void addEvent(Event*);
+
+ // ----- SIMULATION STATE -----
+
+ // simulation global variables
+ double currentTime;
+
+ // list of spikes and events
+ priority_queue<Event, vector<Event*>, PEventGreater> pendingSpikes;
+
+ // list of discontinous dopamin changes (time, amount), sorted by time (newest is front)
+ std::list<pair<double, double> > da_history;
+
+ // ----- HELPER VARS -----
+
+ // reflection & traces
+ std::list<OutputInterface<SpikeMUX> *> spikeOIfList;
+
+ std::set<Bin*> binSets;
+
+ // file descriptors
+ FILE *fd_ineuron,
+ *fd_isynapse,
+ *fd_ispike,
+ *fd_iglobal,
+ *fd_oneuron,
+ *fd_osynapse,
+ *fd_ospike,
+ *fd_oglobal,
+ *fd_trace; // command file
+
+ // debug vars
+#ifdef DEBUG_STATUSLINE
+ long long numSpikes; // number of spikes (counted after axon hillock) processed so far
+ map<int, int> eventCount;
+ int charCount;
+#endif
+};
+
+// init neural network
+Simulation s;
+
+
+#endif // SIMULATE_H
contact: Jan Huwald // Impressum