Use play-Vector on NetCon weight

The basics of how to develop, test, and use models.
Post Reply
ChrisR

Use play-Vector on NetCon weight

Post by ChrisR »

Hi,
it seems that this is trickier than I thought.

I want to modulate the weight of a NetCon object with a vector I am reading from a file.

So I start with:

Code: Select all

finter=0
interspike.play(&finter, interspiket, 1)
wich is working, because I can see that variable finter is plotted correctly.

but when I create the Netcon object:

Code: Select all

 ncGABA = new NetCon(nil, exp2syn, 0.5, 0, finter*weight_const) 
it seems that finter always takes the value it has been initialized to, in this case 0, and never modulates the weight.

Might this be due to the fact that I define my synaptic events via:

Code: Select all

ncGABA.event(eventime)
Do I have to add something that always updates the weight?

Thanks for your help,
Chris
ted
Site Admin
Posts: 6305
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Use play-Vector on NetCon weight

Post by ted »

ChrisR wrote:when I create the Netcon object:

Code: Select all

 ncGABA = new NetCon(nil, exp2syn, 0.5, 0, finter*weight_const) 
it seems that finter always takes the value it has been initialized to, in this case 0, and never modulates the weight.
True. The entire statement is executed during model setup, not during simulation execution.
It wouldn't make sense to execute model setup statements repeatedly during simulation
execution.

You want to do this instead
wvec.play(&ncGABA.weight, tvec, 1)
where wvec and tvec are the vectors that hold the sequence of (weight, time) values.
This tells the runtime system that you want the values of wvec to update the values of
ncGABA.weight in the course of a simulation.
Post Reply