Skip to content

General principles

Axel edited this page Oct 28, 2024 · 3 revisions

General principles of behavior_control

In this page are summarized the general ideas behind the design of behavior_control.

This page is meant to be a first starting point to understand the structure of the code, and the interactions between the different components.

In short, the code is articulated around 5 main files:

  • DetectionGUI.m: this script creates and launches the interactive user interface, initializing parameters with default values.
  • defining_session.m: this script instantiates several data acquisition sessions using the National Instrument (NI) devices (Dev1, etc.) in your behaviour PC, initializes some global variables, starts the data acquisition of the behavioural session.
  • update_parameters.m: this script reads the state of the GUI to update parameters at each trial.
  • main_control.m: this script interacts with the main incoming data stream to define conditional commands to control the exeuction of the behavioural task.
  • stop_session.m: this script stops the behavioural session by stopping all data acquisition sessions and closing open files.

The following flow chart briefly summarizes how these 5 files interact during the behaviour session and when starting/stopping the session.