Runtime mode
Simulation loop runs in Python, calls compiled blocks to do the work
Very flexible, can be combined with arbitrary Python code Overhead from running Python, especially for small networks
Standalone mode
Everything (models + connection definitions, initializations)
written out to a standalone C++ project
Compiled binary executes full run and stores results to disk Fast, no Python overhead
Can be tailored to other platforms Less flexible, no Python interaction during run
arbitrary labels/properties in models → descriptive connection declaration
neuron = NeuronGroup(100, model="""# ... actual neuron model
neuron_type : integer (constant)
x : meter (constant)
y : meter (constant)""")
neuron.neuron_type = 'int(rand() * 2)'# two types
neuron.x = '(i % 10) * 50*um'# Neurons arranged in a grid
neuron.y = '(i // 10) * 50*um'
synapses = Synapses(neuron, neuron) # do-nothing synapse just for illustration
synapses.connect('neuron_type_pre == neuron_type_post', # only if same type
p='1.5*exp(-sqrt(((x_pre - x_post)**2 +'' (y_pre - y_post)**2))/(100*um))')
Stimberg, M., Brette, R., & Goodman, D. F. (2019). Brian 2, an intuitive and efficient neural simulator. ELife, 8, e47314. 10.7554/eLife.47314
Stimberg, M., Goodman, D. F. M., Brette, R., & Pittà, M. D. (2019). Modeling Neuron–Glia Interactions with the Brian 2 Simulator. In M. De Pittà & H. Berry (Eds.), Computational Glioscience (pp. 471–505). Springer International Publishing. 10.1007/978-3-030-00817-8_18
Stimberg, M., Goodman, D. F. M., Benichoux, V., & Brette, R. (2014). Equation-oriented specification of neural models for simulations. Frontiers in Neuroinformatics, 8. 10.3389/fninf.2014.00006