Animal-in-the-loop system to investigate adaptive behavior. (2nd September 2018)