inincs / pyNCS

pyNCS is a python library that allows easy access to Neuromorphic Chips and Systems (NCS),
http://inincs.github.com/pyNCS/
GNU General Public License v2.0
16 stars 10 forks source link

Sorting in AddrGroup, Population objects #9

Closed sheiksadique closed 11 years ago

sheiksadique commented 11 years ago

I just went through some of the code in Population class, and there are calls to sort addresses everywhere.

Is sorting really important ? Why should it be done ?

The reason I ask is..

1) Lets assume for some reason, I made a fancy arrangement of my neurons that is not logical or physical address sorted. Now when I try to populate the synapses, all of a sudden all the population gets rearranged. Now weather or not one should choose to have weird arrangements of neurons is a whole different issue. But assuming it does matter to some one, the current implementation breaks it down.

2) Isn't sorting expensive ? So why bother ? (unless ofcourse the user explicitly wants something to be sorted.)

Now, IF i were to comment out all the sorting calls, will the implementation break down ?

fabioedoardoluigialberto commented 11 years ago

For the moment thee is no association between soma addresses and synapse addresses but their position on their respective arrays. The association is important because we populate by giving soma arrays and then create the corresponding synapse addresses. Since there is no guarantee that the positions are correctly maintained, every operation performs a sorting, so that we know what is what.It was the implementation - wise fastest solution at that time. There are tons of better solutions.The answer to your question is: maybe... The code won't raise errors but you are not guaranteed you are doing the correct thing.Merry Xmas (if you care)

sheiksadique commented 11 years ago

Ok cool. I am a little scared to touch the code in there.. Its super complicated out there! So i won't be bothering with it.

Merry Christmas to you too.. ! (And to the pyNCS team ;))