run function
(Shortest import: from brian2 import run)
- brian2.core.magic.run(duration, report=None, report_period=10 * second, namespace=None, level=0)[source]
Runs a simulation with all “visible” Brian objects for the given duration. Calls
collect()
to gather all the objects, the simulation can be stopped by calling the globalstop()
function.In order to avoid bugs, this function will occasionally raise
MagicError
when the intent of the user is not clear. See the notes toMagicNetwork
for more details on this point. If you persistently see this error, then Brian is not able to safely guess what you intend to do, and you should use aNetwork
object and callNetwork.run
explicitly.