nest / nest-gpu

NEST GPU
https://nest-gpu.readthedocs.io
GNU General Public License v2.0
19 stars 12 forks source link

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

Open Lylist opened 8 months ago

Lylist commented 8 months ago

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.