DelayedMixin

class DelayedMixin(step_time: float, delay: float)[source]

Bases: object

Mixin for modules with delay-record tensors with shared step time and duration.

Attributes which have are registered as constrained this way will have a constraint on their final dimension equal to the computed record size.

Parameters:
  • step_time (float) – length of time between stored values in the record.

  • delay (float) – length of time over which prior values are stored.

Caution

RecordTensor attributes must be added as attributes prior to initialization.

add_delayed(*attr: str) None[source]

Add delay-dependent attributes.

Each attribute must specify the name of a RecordTensor.

Parameters:

*attr (str) – names of the attributes to set as batched.

property delay: float

Maximum supported delay, in milliseconds.

Returns:

maximum supported delay.

Return type:

float

property dt: float

Length of the simulation time step, in milliseconds.

Parameters:

value (float) – new simulation time step length.

Returns:

present simulation time step length.

Return type:

float