Using VecStim to deliver synaptic events

The basics of how to develop, test, and use models.
Post Reply
Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Using VecStim to deliver synaptic events

Post by Yaeger »

Hi all,

I am trying to use a user-defined vector to hold event times that are then delivered using the play method of the VecStim class. The goal is to set the event times in the vector and then use these times to trigger a synapse. I am having some problems.

Here is the code:

Code: Select all

// synapse
objref syn
soma syn = new ExpSyn1(0.5)

// create vector for spike times
objref svec
svec = new Vector()
proc interval () { local i, x
	low = $1
	reps = $3
	x = low
	dx = $2
	for i = 1,reps {
		svec.append(x)
		x = x + dx
		}
}

// set delay, interval, reps
interval(50, 10, 10)

// create a vector stim that generates events at times in svec
objref vecstim
vecstim = new VecStim()
vecstim.play(svec)

// attach the VecStim to synapse
objref ncl
ncl = new List()
ncl.append(new NetCon(vecstim, syn))
ncl.delay = 0
ncl.weight = 1
When I open the file in Neuron, I get the following message:
delay not a public member of List

I also get a similar message telling me that weight is not a public member of List. How do I set delay and weight here?

I would appreciate any help I can get. I know that there have been similar posts, but those have been different enough that I have had trouble understanding where I am going wrong.

Thanks.
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Using VecStim to deliver synaptic events

Post by ted »

Yaeger wrote:

Code: Select all

ncl = new List()

ncl.append(new NetCon(vecstim, syn))
ncl.delay = 0
ncl.weight = 1
When I open the file in Neuron, I get the following message:
delay not a public member of List
because ncl is an instance of the List class.
How do I set delay and weight
Refer to the NetCon, not the List. This NetCon is the last object appended to the list, so you want to execute
ncl.o(ncl.count()-1).delay = 0
Why ncl.count()-1? Because the elements in a list are numbered 0...List.count()-1.

Be sure to read about the List class's o() and object() methods.

Comment: if your model has only one NetCon, there's no need for a List.
Yaeger
Posts: 33
Joined: Mon Aug 19, 2013 4:36 pm

Re: Using VecStim to deliver synaptic events

Post by Yaeger »

Thanks Ted for the helpful and rapid response! That took care of it.
Post Reply