1
Data structure for the Synapses object
2
======================================
3
* 1 SpikeQueue for pre and post (can be a Brian contained object or could be called by the Synapses object)
6
* synapse -> variables (w) (floats)
7
could be separated between continuously updated variables (i.e., not parameters) to be put in _S and other ones
8
This should be a dynamic state matrix (extendable 2D array).
10
* synapse -> presynaptic i (int32 or smaller, based on the size of the presynaptic group)
11
This should be a dynamic vector.
12
I call it 'presynaptic' for now.
13
* synapse -> postsynaptic j (same)
14
I call it 'postsynaptic' for now.
15
* synapse -> presynaptic delay (depending on max delay? but this is not known at the beginning)
16
This is better than presynaptic i -> delay for construction.
17
* synapse -> postsynaptic delay
19
The synaptic mappings should be addressable by (pre,post) number (2D or 3D).
20
This could be done using separate objects, one per synaptic variable. There would be a dictionary
23
Pre/post mappings (useful for construction and spike queues):
24
* presynaptic i -> synapse indexes (int32 or more? depending on len(pre)*len(post))
25
List of dynamic arrays
26
* postsynaptic j -> synapse indexes
29
* presynaptic/postsynaptic code and namespace (pre_code,pre_namespace)
31
Accessing synaptic variables
32
----------------------------
33
To do something like S.w[1,2]=1*nS
34
we need to have a special vector class that can be indexed with pre/post indexes.
35
First, the setattr method can be directly inherited from NeuronGroup, except
36
for the delays. It allows things like:
38
although maybe this should not be allowed.
40
The import method is getattr. It returns an object with a getitem that allows
41
2 and 3D access to an underlying sparse matrix.