Closed denniskb closed 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.
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
).
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...
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
'sNeur
parameter intoSrcNeur
andDstNeur
, both of which conform toStatefulNeuron
. 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.