Clock class
(Shortest import: from brian2 import Clock)
- class brian2.core.clocks.Clock(*args, **kw)[source]
Bases:
VariableOwner
An object that holds the simulation time and the time step.
- Parameters:
dt : float
The time step of the simulation as a float
name : str, optional
An explicit name, if not specified gives an automatically generated name
Notes
Clocks are run in the same
Network.run
iteration ift
is the same. The condition for two clocks to be considered as having the same time isabs(t1-t2)<epsilon*abs(t1)
, a standard test for equality of floating point values. The value ofepsilon
is1e-14
.Attributes
The time step of the simulation in seconds.
The time step of the simulation as a float (in seconds)
The relative difference for times (in terms of dt) so that they are considered identical.
Methods
set_interval
(self, start, end)Set the start and end time of the simulation.
Details
- dt
The time step of the simulation in seconds.
- dt_
The time step of the simulation as a float (in seconds)
- epsilon_dt
The relative difference for times (in terms of dt) so that they are considered identical.
- set_interval(self, start, end)
Set the start and end time of the simulation.
Sets the start and end value of the clock precisely if possible (using epsilon) or rounding up if not. This assures that multiple calls to
Network.run
will not re-run the same time step.