Constant class
(Shortest import: from brian2.core.variables import Constant)
- class brian2.core.variables.Constant(name, value, dimensions=Dimension(), owner=None)[source]
Bases:
Variable
A scalar constant (e.g. the number of neurons
N
). Information such as the dtype or whether this variable is a boolean are directly derived from thevalue
. Most of the timeVariables.add_constant
should be used instead of instantiating this class directly.- Parameters:
name : str
The name of the variable
dimensions :
Dimension
, optionalThe physical dimensions of the variable. Note that the variable itself (as referenced by value) should never have units attached.
value: reference to the variable value :
The value of the constant.
owner :
Nameable
, optionalThe object that “owns” this variable, for constants that belong to a specific group, e.g. the
N
constant for aNeuronGroup
. External constants will haveNone
(the default value).
Attributes
The constant's value
Methods
Return the value associated with the variable (without units).
item
()Details
- value
The constant’s value