accessing fields of custom neurons 

Hello,

My neuron has several fields, this works fine, however, problems occured, when I wanted to access (only read) them from onStep(). All the props have flags 0, that is fine. Then I'm recording the fields in every time step, for every creature and every neuron, in the onStep() function, like this (instead of saving I write it out):

for (j=0; j<CreaturesGroup.creaturecount;j++)
 for (k=0;k<CreaturesGroup.getCreature(j).numneurons;k++)
 {
	localNeuro = CreaturesGroup.getCreature(j).getNeuro(k);
	var iobj=Interface.makeFrom(localNeuro.neuroproperties);
	if ((iobj.getId(3)) == "synapsesStrengthArray")  //I know this is true in my neuron
	{
	    Simulator.message(localNeuro.neuroproperties.my1stField,-1);
		//... printing out or saving all the properties, and
    	    Simulator.message(localNeuro.state,-1);
 }

I have several custom neurons of the same type in one creature. The problem is that I get back the same content of fields for every neuron in a creature (sometimes even for different creatures)! This is however, not correct, I have also added a field ID to the neurons which is different for every neuron, and I also tried printing the content of fields from the neuron directly (in the .neuro file, go()) and it worked fine, giving unique content of fields. I am also sure that different neurons are accessed, since the localNeuro.state is different. It seems that the state of the neuron can be accessed, is uptodate, but the unique fields of the neurons cannot.

I need to record the field values for a particular creature and all its neurons, during the creatures life, to evaluate my experiments (with plastic synapses). Thus I think that I have to get these from the expdef, accessing Creature - Neuro - fields.

Does anybody see what I'm doing wrong? Thanks a lot. Matej

P.S. I'm using version Win2_10_12

Forums: 
Szymon Ulatowski's picture

Your code is correct.
Unfortunately you have just found a bug in framsticks (thanks!)

Looks like "neuron.neuroproperties" in custom neurons always references the most recently created neuron instance of a given class.

The bugfix will be published as soon as possible.

Hi,

Is there a bugfix available yet, or the developmental version of the new code?
I seem to have stumbled on the problem aswell :S.

Tom

Maciej Komosinski's picture

Version 3.0rc1 now available at http://www.framsticks.com/apps-devel