NeuronGroup class
(Shortest import: from brian2 import NeuronGroup)
- class brian2.groups.neurongroup.NeuronGroup(*args, **kw)[source]
Bases:
Group
,SpikeSource
A group of neurons.
Attributes
The refractory condition or timespan
Code that is triggered on events (e.g. reset).
Events supported by this group
The state update method selected by the user
Reset neurons which have spiked (or perform arbitrary actions for user-defined events)
The spikes returned by the most recent thresholding operation.
Performs numerical integration step
Update the "constant over a time step" subexpressions
Checks the spike threshold (or abitrary user-defined events)
The original equations as specified by the user (i.e. without the multiplied
int(not_refractory)
term for equations marked as(unless refractory)
).Methods
before_run
([run_namespace])Optional method to prepare the object before a run.
run_on_event
(event, code[, when, order])Run code triggered by a custom-defined event (see
NeuronGroup
documentation for the specification of events).The createdResetter
object will be automatically added to the group, it therefore does not need to be added to the network manually.set_event_schedule
(event[, when, order])Change the scheduling slot for checking the condition of an event.
state
(name[, use_units, level])Return the state variable in a way that properly supports indexing in the context of this group
Details
- _refractory
The refractory condition or timespan
- event_codes
Code that is triggered on events (e.g. reset)
- events
Events supported by this group
- method_choice
The state update method selected by the user
- resetter
Reset neurons which have spiked (or perform arbitrary actions for user-defined events)
- spikes
The spikes returned by the most recent thresholding operation.
- state_updater
Performs numerical integration step
- subexpression_updater
Update the “constant over a time step” subexpressions
- thresholder
Checks the spike threshold (or abitrary user-defined events)
- user_equations
The original equations as specified by the user (i.e. without the multiplied
int(not_refractory)
term for equations marked as(unless refractory)
)
- before_run(run_namespace=None)[source]
Optional method to prepare the object before a run.
Called by
Network.after_run
before the main simulation loop starts.
- run_on_event(event, code, when='after_resets', order=None)[source]
Run code triggered by a custom-defined event (see
NeuronGroup
documentation for the specification of events).The createdResetter
object will be automatically added to the group, it therefore does not need to be added to the network manually. However, a reference to the object will be returned, which can be used to later remove it from the group or to set it to inactive.