Trial-by-trail data collection

MEDState Notation Repository Forums Coding Help Archive Trial-by-trail data collection

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #12590
    Med_Support
    Moderator
    Dave Hughes
    DIM D = 100
    
    S.S.1,
    S1,
    #R1: ADD D(J) ---> SX
    
    S.S.2,
    S1,
    #R2: ADD D(J+1) ---> SX
    
    S.S.3,
    S1,
    1": ADD T; IF T >= 60 [@True, @False]
    @True: SET J = J+2, T = 0 ---> SX
    @False: ---> SX
    

    This program bins data every 60 seconds, which is how long a trial is. Once the timer T reaches 60, it adds 2 to each of the D elements that are recording responses.

    Example:

    0-60 seconds. A response on input 1 will add 1 to D(0), and a response on input 2 will add 1 to D(1)

    60-120 seconds. A response on input 1 will add 1 to D(2), and a response on inputs 2 will add 1 to D(3)

    120-180 seconds. A response on input 1 will add 1 to D(4), and a response on input 2 will add 1 to D(5)

     

    You can now examine how many responses were made during a certain amount of time. The 60 second bin can be changed to any time element, but it has to be in seconds. Ex. 300 equals 5 minutes.

    One could also change it so a bin occurs when another type of input is given. A Z-pulse could be used just as easily.

    S.S.3,
    S1,
    #Z1: SET J = J+2 ---> SX
    

    *************************************************

    Here is an example of a Fixed Ratio program that records data from each lever as well as rewards according to 1 minute time bins.

    Inputs
    ^RightLever = 1
    ^LeftLever = 2
    
    Outputs
    ^Reward = 1
    
    DIM D = 100
    
    DISKCOLUMNS = 3
    
    S.S.1,
    S1,
    #R^RightLever: ADD D(J), X; IF X >= 5 [@True, @False]
    @True: SET X = 0; Z1 ---> SX
    @False: ---> SX
    
    S.S.2,
    S1,
    #R^LeftLever: ADD D(J+1) ---> SX
    
    S.S.3,
    S1,
    #Z1: ADD D(J+2); ON ^Reward ---> S2
    S2,
    0.5": OFF ^Reward ---> S1
    
    S.S.4,
    S1,
    1": ADD T; IF T >= 60 [@True, @False]
    @True: SET J = J+3, T = 0; SET D(J+3) = -987.987 ---> SX
    @False: ---> SX
    
    

    I have added in another element to the D array, a reward counter D(J+2). Now I have to add 3 to J because there are three things being recorded in each bin.

    Example:

    0-60 seconds. A response on Right Lever will add 1 to D(0), and a response on Left Lever will add 1 to D(1), and a reward issued will add 1 to D(2)

    60-120 seconds. A response on input 1 will add 1 to D(3), and a response on inputs 2 will add 1 to D(4), and a reward issued will add 1 to D(5)

    120-180 seconds. A response on input 1 will add 1 to D(4), and a response on input 2 will add 1 to D(6), and a reward issued will add 1 to D(7)

     

    Since I set the DISKCOLUMNS equal to 3, there will now only be 3 columns in the arrays on the data file:

    D:
    0: 3.000 2.000 0.000
    3: 2.000 1.000 1.000
    6: 10.000 0.000 2.000

    *************************************************

    The possibilities are endless for using this type of data recording. Stick to the basic outline above and you are ready to rock and roll!

    Dave

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.