Weights being reset in parallel NetCons

General issues of interest both for network and
individual cell parallelization.

Moderator: hines

Post Reply
mctavish
Posts: 74
Joined: Tue Mar 14, 2006 6:10 pm
Location: New Haven, CT

Weights being reset in parallel NetCons

Post 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
hines
Site Admin
Posts: 1687
Joined: Wed May 18, 2005 3:32 pm

Re: Weights being reset in parallel NetCons

Post 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).
Post Reply