New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++ standalone ignores the active property #718

Closed
mstimberg opened this Issue Jun 15, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@mstimberg
Member

mstimberg commented Jun 15, 2016

In runtime mode, you can switch off an object by setting its active attribute to False. This can be useful to switch inputs/monitors on/off between runs or when using the store/restore mechanism (because you are not allowed to add/remove objects in that case). This does not work in standalone mode, e.g. the following continues to integrate v while in runtime it would remain constant after the first run:

from brian2 import *
set_device('cpp_standalone', build_on_run=False)
group = NeuronGroup(1, 'dv/dt = -v/(10*ms) : 1')
group.v = 1
mon = StateMonitor(group, 'v', record=0)
run(5*ms)
group.active = False
run(5*ms)
device.build()

plot(mon.t/ms, mon[0].v)
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment