HenryJFlynn / mouse2afc

The Mouse2AFC experimental neuroscience protocol.
GNU General Public License v3.0
0 stars 0 forks source link

Create Second Experiment Feature #52

Closed HenryJFlynn closed 1 year ago

HenryJFlynn commented 1 year ago

Mirror matlab.

the second experiment works as a distraction. If light is the primary experiment, and sound is the second. a reward is given based on what ports light up while sounds will be played at random and vise versa. The second experiment is not related to reward or punish nor change how the function of the experiment. It sole purpose is to add another stimulus as a distraction

TODO:

HenryJFlynn commented 1 year ago

How matlab works:

in stateMatrix.m before any states are added, the variables for what stimulus is triggered are set. They are set by the function HandleStateMatrixStim. This function returns three variables:

  1. DeliverStimulus
  2. ContDeliverStimulus
  3. StopStimulus

which are used later as output actions of varies states. These variables can have two entries, the first is the primary experiment stim and the second is the secondary stim. They are each created by the function SingleExpType which is defined within HandleStateMatrixStim. SingleExpType is an if statement assigning values to the three variables based on experiment type. It is called twice, once with the primary experiment type and second time with the secondary experiment type.

So stateMatrix.m calls HandleStateMatrixStim which uses SingleExpType to fill in the three variables. The variables are then used in the state matrix to trigger stimulus depending on primary and secondary experiment type

HenryJFlynn commented 1 year ago

I must move a section of code from the state matrix init into a utils function. I must call that function and have it return DeliverStimulus, ContDeliverStimulus, and StopStimulus

HenryJFlynn commented 1 year ago

^^^ nah that complicated things. I created handle_state_matrix_stim as a function in state_matrix.py and then called it within the init statement. Pretty much just moved code from the init statement into a function so that I could run the function twice, once for primary and one for secondary then called the function in the same place in the init

HenryJFlynn commented 1 year ago

how state_matrix.py works feels wrong. Everything is inside of the init. In creating a function I had to make some awkward looking code to make it work because the whole thing is awkward. Gonna add this to the list of things to fix