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.

Attributes

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.

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.