4.7.3. pde.trackers.intervals module

Module defining classes for time intervals for trackers

The provided interval classes are:

ConstantIntervals

class representing equidistantly spaced time intervals

LogarithmicIntervals

class representing logarithmically spaced time intervals

RealtimeIntervals

class representing time intervals spaced equidistantly in real time

class ConstantIntervals(dt: float = 1, t_start: float = None)[source]

Bases: object

class representing equidistantly spaced time intervals

Parameters
  • dt (float) – The duration between subsequent intervals. This is measured in simulation time units.

  • t_start (float, optional) – The time after which the tracker becomes active. If omitted, the tracker starts recording right away. This argument can be used for an initial equilibration period during which no data is recorded.

copy()[source]

return a copy of this instance

next(t: float) float[source]

computes the next time point based on the current time t

Parameters

t (float) – The current time point of the simulation

IntervalType

alias of ConstantIntervals

class LogarithmicIntervals(dt_initial: float = 1, factor: float = 1, t_start: float = None)[source]

Bases: ConstantIntervals

class representing logarithmically spaced time intervals

Parameters
  • dt_initial (float) – The initial duration between subsequent intervals. This is measured in simulation time units.

  • factor (float) – The factor by which the time between intervals is increased every time. Values larger than one lead to time intervals that are increasingly further apart.

  • t_start (float, optional) – The time after which the tracker becomes active. If omitted, the tracker starts recording right away. This argument can be used for an initial equilibration period during which no data is recorded.

next(t: float) float[source]

computes the next time point based on the current time t

Parameters

t (float) – The current time point of the simulation

class RealtimeIntervals(duration: Union[float, str], dt_initial: float = 0.01)[source]

Bases: ConstantIntervals

class representing time intervals spaced equidistantly in real time

This spacing is only achieved approximately and depends on the initial value set by dt_initial and the actual variation in computation speed.

Parameters
  • duration (float or str) – The duration (in realtime seconds) that the intervals should be spaced apart. The duration can also be given as a string, which is then parsed using the function parse_duration().

  • dt_initial (float) – The initial duration between subsequent intervals. This is measured in simulation time units.

next(t: float) float[source]

computes the next time point based on the current time t

Parameters

t (float) – The current time point of the simulation

get_interval(interval: Union[ConstantIntervals, float, int, str]) ConstantIntervals[source]

create IntervalType from various data formats

If interval is of type IntervalType it is simply returned