NeuronGroup class¶
(Shortest import: from brian2 import NeuronGroup)
-
class
brian2.groups.neurongroup.NeuronGroup(N, model, method=('exact', 'euler', 'heun'), method_options=None, threshold=None, reset=None, refractory=False, events=None, namespace=None, dtype=None, dt=None, clock=None, order=0, name='neurongroup*', codeobj_class=None)[source]¶ Bases:
brian2.groups.group.Group,brian2.core.spikesource.SpikeSourceA group of neurons.
Attributes
_refractoryThe refractory condition or timespan event_codesCode that is triggered on events (e.g. eventsEvents supported by this group method_choiceThe state update method selected by the user resetterReset neurons which have spiked (or perform arbitrary actions for user-defined events) spikesThe spikes returned by the most recent thresholding operation. state_updaterPerforms numerical integration step subexpression_updaterUpdate the “constant over a time step” subexpressions thresholderChecks the spike threshold (or abitrary user-defined events) user_equationsThe original equations as specified by the user (i.e. 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 NeuronGroupdocumentation for the specification of events).The createdResetterobject 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_runbefore 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
NeuronGroupdocumentation for the specification of events).The createdResetterobject 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.
-