NCurvesValidator class

Validate that there aren’t too many curves per trial (i.e., that the participant is not zigzagging)

A curve is defined as a trajectory section where the finger/mouse consistently changes its course in the same direction (clockwise or counter-clockwise).

Methods and properties:

class trajtracker.validators.NCurvesValidator(direction_monitor=None, max_curves_per_trial=None, enabled=True)
__init__(direction_monitor=None, max_curves_per_trial=None, enabled=True)

Constructor - invoked when you create a new object by writing NCurvesValidator()

Parameters:
disable_event

The event on which the object should be disabled. This will work only when the object is registered to an EventManager

Note: This property is deprecated, use disable_events instead

Type:Event
disable_events

The events on which the object should be disabled. This will work only when the object is registered to an EventManager

Type:collection of Event objects
enable_event

The event on which the object should be enabled. This will work only when the object is registered to an EventManager

Note: This property is deprecated, use enable_events instead

Type:Event
enable_events

The events on which the object should be enabled. This will work only when the object is registered to an EventManager

Type:collection of Event objects
enabled

Whether the object is currently functioning or disabled

Type:bool
log_level

Logging level of this object: trajtracker.log_none, log_error (default), log_warn, log_info, log_debug, log_trace

max_curves_per_trial

Maximal number of curves allowed per trial.

min_angle_change_per_curve

A curve must change the finger/mouse direction by at least this amount (specified in degrees). Smaller changes do not count as curves. (see DirectionMonitor.min_angle_change_per_curve)

min_distance

The minimal distance between points required for calculating direction (see DirectionMonitor.min_distance)

reset(time0=None)

Called when a trial starts - reset any previous curves

update_xyt(position, time_in_trial, time_in_session=None)

Validate the number of curves in the trial

Parameters:
  • position – Current (x,y) coordinates
  • time_in_trial – Time, in seconds. The zero point doesn’t matter, as long as you’re consistent until reset() is called.
  • time_in_session – ignored
Returns:

None if all OK, ExperimentError if error