nest-gpu icon indicating copy to clipboard operation
nest-gpu copied to clipboard

How can I make the spike_generator to generate spikes in loop simulation?

Open Lylist opened this issue 11 months ago • 0 comments

I would like to run the simulation automatically with a loop to test STDP. It looks like this :

sg = nestgpu.Create("spike_generator")
spike_times = [[50.0], [150.0], [250.0]]
ngpu.ActivateRecSpikeTimes(sg, 100)
for i in range(3):
    nestgpu.SetStatus(sg, {"spike_times": spike_times[i]})
    nest.Simulate(100.0)
    print(nestgpu.GetRecSpikeTimes(sg))

I found that when executing code similar to the above, the spike generator only fires once. What can i do? Thank you.

Lylist avatar Mar 14 '24 08:03 Lylist