EventClock class¶
(Shortest import: from brian2 import EventClock)
- class brian2.core.clocks.EventClock(*args, **kw)[source]¶
Bases:
BaseClockA clock that advances through a predefined sequence of times.
- Parameters:
times : array-like
The sequence of times for the clock to advance through
name : str, optional
An explicit name, if not specified gives an automatically generated name
Methods
advance()Advance to the next time in the sequence.
same_time(other)Check if two clocks are at the same time.
set_interval(start, end)Set the start and end time of the simulation.
Details
- same_time(other)[source]¶
Check if two clocks are at the same time.
For comparisons with
Clockobjects, uses the Clock’s dt and epsilon_dt. For comparisons with otherEventClockorBaseClockobjects, uses the base epsilon value.- Parameters:
other : BaseClock
The other clock to compare with
- Returns:
bool :
True if both clocks are at the same time