EventClock class

(Shortest import: from brian2 import EventClock)

class brian2.core.clocks.EventClock(*args, **kw)[source]

Bases: BaseClock

A 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

advance()[source]

Advance to the next time in the sequence.

same_time(other)[source]

Check if two clocks are at the same time.

For comparisons with Clock objects, uses the Clock’s dt and epsilon_dt. For comparisons with other EventClock or BaseClock objects, 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

set_interval(start, end)[source]

Set the start and end time of the simulation.

Parameters:

start : second

The start time of the simulation

end : second

The end time of the simulation