Page 1 of 1

Weights being reset in parallel NetCons

Posted: Mon Jun 15, 2009 9:06 pm
by mctavish
I am using nc_append() to make a NetCon, but the weight is a vector. Since nc_append() seems to only accept a double for the weight, which gets assigned weight[0], I want to change the weight of subsequent elements of that vector, which I can seem to do by

Code: Select all

pnm.nclist.o(objidx).weight[elem]=newVal
I can validate that the value took if I print the value,

Code: Select all

print pnm.nclist.o(objidx).weight[elem]
However, once I run(), weight[elem] gets reset to zero. I can, however, change weight[0] with this technique and it sticks.

How can I either send a vector using nc_append() or set these elements properly?

Thanks,
Tom

Re: Weights being reset in parallel NetCons

Posted: Tue Jun 16, 2009 11:30 am
by hines
The user can set the weights of NetCon.weight for i>0 after finitialize() returns or with
an FInitializeHandler. This is because all those i>0 elements are initialized to 0 near
the beginning of finitialize() (also that is when the NET_RECEIVE() { INITIAL { ...} } block,
if it exists, is called to initialize them).