denniskb / spice2

The Spice SNN Simulator
Other
6 stars 0 forks source link

Support SSSP #26

Closed denniskb closed 2 years ago

denniskb commented 2 years ago

In order to implement the SSSP algorithm, synapses' deliver methods must have access to the source neuron. The straighforward way would be to convert the Synapse's Neur parameter into SrcNeur and DstNeur, both of which conform to StatefulNeuron. However, consider an alternative formulation that does not clutter our concepts further. Also remember that the source type cannot be known since the same synapse type could be used to connect multiple connections. We would either have to create a separate synapse type per connection (which might only differ in the type of its neuron parameters) or we could relax our concepts and synapse requirements.

denniskb commented 2 years ago

I'm leaning toward relaxation. The dst neuron should not be checked upon synapse creation time, but upon connection time. Also consider that the user could already (want to) re-use the same synapse with different destination neuron types -- which currently isn't possible.

denniskb commented 2 years ago

Another alternative would be to overload the deliver() method which would work fine from a template and framework POV (the correct overload would be selected). However, concepts don't lend themselves to overloading. One more reason to relax our concepts (and implement the type erasure + checks at the level of the synapse_population).

denniskb commented 2 years ago

Check out the ObjectMock example by Andreas Fertig here:https://andreasfertig.blog/2020/08/cpp20-concepts-testing-constrained-functions/ He's using a templated class and requires clauses to turn features of the class on and off. Perhaps we could use that technique in our own mock classes (test of concepts.cpp) to avoid typing out all combinations...