Creating a Two-Alternative Forced Choice (2AFC) Task
A mouse is in a Bpod-controlled environment with 3 behavioral ports (left: port 1, center: port 2, right: port 3), each consisting of an infrared-based photogate for poke detection, a white LED, and a water reward system based on a valve that can be opened. In addition, an external (abstract) auditory stimulus system is presenting a sound stimulus to the animal using 2 speakers – one on the left and one on the right side of the environment. This sound system can be controlled using a callback function (virtual action)
PresentStimulus, that accepts a numerical argument as the stimulus type. The stimulus itself consists of varying click sounds on the 2 speakers. The animal now has to identify, on which side more click sounds were presented by poking into the corresponding behavioral port. If the animal choses to poke into the correct port, it receives a water reward for a pre-defined, fixed duration (RewardDuration). If the animal choses to poke into the opposite side though, the whole trial will pause for a pre-defined, fixed duration (TimeOutDuration).
The trial type, which speaker should present more clicks (and which behavioral port is being rewarded), is defined outside the actual task description and being passed as an argument to it. Same is true for the actual stimulus that is being presented to the animal.
To initialize a new trial, the white LED in the center port is turned on and the system waits until the mouse pokes into the center port. As soon as that happens, the stimulus is being presented for 5 seconds. If the animal identifies the correct side, it is being rewarded. If the animal misses to report its decision within the 5 second time window or selects the wrong port, the TimeOut is being introduced as some form of punishment. After either delivering the reward or pausing the trial, an Inter-Trial-Interval of a pre-defined duration is being added to the end of the trial.
- While implementing the task, work yourself through the five different tabs inside the BEADL Designer from “left to right”
- Look at the template implementation of the Light Chasing Task at the BEADL online documentation
Possible Task Implementation
One possible BEADL implementation of this task can be downloaded here as
.json file that can be imported into the user’s workspace.