Fix GetConnections to correctly get connections where the target is a global receiving device #1251
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes an issue with GetConnections, where it would not get the connection if the specified target is a global receiving device.
In jakobj#104, to improve the performance of GetConnections, targets are split into vectors containing neurons and devices. However, even though the global receiving device target is a device, it is connected in the same way as a normal neuron node. This means that the connection is never added to
TargetTableDevices
, and the connection isn't found.This PR changes the splitting function to put global receiving devices in the neuron vector, which allows GetConnections to correctly get the connections. Two tests are also added, checking that GetConnections with specified source and target always gets the connection.
Fixes #1190.