IntervalDiscrimination#

class braintools.cogtask.IntervalDiscrimination(t_fixation=Quantity(500., 'ms'), t_interval1=(Quantity(400., 'ms'), Quantity(800., 'ms')), t_delay=Quantity(500., 'ms'), t_interval2=(Quantity(400., 'ms'), Quantity(800., 'ms')), t_response=Quantity(500., 'ms'), **kwargs)[source]#

Interval Discrimination task.

Agent compares durations of two intervals and indicates which is longer.

Structure: Fixation >> Interval1 >> Delay >> Interval2 >> Response

Parameters:
  • t_fixation (Quantity) – Fixation duration (default: 500ms).

  • t_interval1 (tuple) – (min, max) for first interval duration (default: (400ms, 800ms)).

  • t_delay (Quantity) – Delay duration (default: 500ms).

  • t_interval2 (tuple) – (min, max) for second interval duration (default: (400ms, 800ms)).

  • t_response (Quantity) – Response duration (default: 500ms).

  • seed (int, optional) – Random seed.

Examples

>>> task = IntervalDiscrimination()
>>> X, Y, info = task.sample_trial(0)
define_features()[source]#

Define input and output features.

Override in subclass for class-based task definition.

Return type:

Tuple

Returns:

  • input_features (Feature or FeatureSet) – Input feature definitions.

  • output_features (Feature or FeatureSet) – Output feature definitions.

define_phases()[source]#

Define the phase structure.

Override in subclass for class-based task definition.

Returns:

The task phase structure (single phase or composition).

Return type:

Phase

trial_init(ctx)[source]#

Initialize trial-level state.

Override in subclass to set up trial parameters like ground_truth, stimulus indices, etc.

Parameters:

ctx (Context) – Trial context to populate with state.

Return type:

None