RuntimeDevice class

(Shortest import: from brian2.devices import RuntimeDevice)

class brian2.devices.device.RuntimeDevice[source]

Bases: brian2.devices.device.Device

The default device used in Brian, state variables are stored as numpy arrays in memory.

Attributes

arrays Mapping from Variable objects to numpy arrays (or DynamicArray objects).

Methods

add_array(var)
fill_with_array(var, arr)
get_array_name(var[, access_data])
get_value(var[, access_data])
init_with_arange(var, start, dtype)
init_with_zeros(var, dtype)
resize(var, new_size)
resize_along_first(var, new_size)
seed([seed]) Set the seed for the random number generator.
set_value(var, value)
spike_queue(source_start, source_end)

Details

arrays

Mapping from Variable objects to numpy arrays (or DynamicArray objects). Arrays in this dictionary will disappear as soon as the last reference to the Variable object used as a key is gone

add_array(var)[source]
fill_with_array(var, arr)[source]
get_array_name(var, access_data=True)[source]
get_value(var, access_data=True)[source]
init_with_arange(var, start, dtype)[source]
init_with_zeros(var, dtype)[source]
resize(var, new_size)[source]
resize_along_first(var, new_size)[source]
seed(seed=None)[source]

Set the seed for the random number generator.

Parameters:

seed : int, optional

The seed value for the random number generator, or None (the default) to set a random seed.

set_value(var, value)[source]
spike_queue(source_start, source_end)[source]

Tutorials and examples using this