StateUpdateMethod class
(Shortest import: from brian2 import StateUpdateMethod)
- class brian2.stateupdaters.base.StateUpdateMethod[source]
Bases:
object
Methods
__call__
(equations[, variables, method_options])Generate abstract code from equations.
apply_stateupdater
(equations, variables, method)Applies a given state updater to equations.
register
(name, stateupdater)Register a state updater.
Details
- abstract __call__(equations, variables=None, method_options=None)[source]
Generate abstract code from equations. The method also gets the the variables because some state updaters have to check whether variable names reflect other state variables (which can change from timestep to timestep) or are external values (which stay constant during a run) For convenience, this arguments are optional – this allows to directly see what code a state updater generates for a set of equations by simply writing
euler(eqs)
, for example.
- static apply_stateupdater(equations, variables, method, method_options=None, group_name=None)[source]
Applies a given state updater to equations. If a
method
is given, the state updater with the given name is used or if is a callable, then it is used directly. If amethod
is a list of names, all the methods will be tried until one that doesn’t raise anUnsupportedEquationsException
is found.