set_device function
(Shortest import: from brian2 import set_device)
- brian2.devices.device.set_device(device, build_on_run=True, **kwargs)[source]
Set the device used for simulations.
- Parameters:
device :
Device
or strThe
Device
object or the name of the device.build_on_run : bool, optional
Whether a call to
run()
(orNetwork.run
) should directly trigger aDevice.build
. This is only relevant for standalone devices and means that a run call directly triggers the start of a simulation. If the simulation consists of multiple run calls, setbuild_on_run
toFalse
and callDevice.build
explicitly. Defaults toTrue
.kwargs : dict, optional
Only relevant when
build_on_run
isTrue
: additional arguments that will be given to theDevice.build
call.