Help modifying FR1 to a progressive ratio

MEDState Notation Repository Forums Coding Help Archive Help modifying FR1 to a progressive ratio

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13339
    Med_Support
    Moderator
    Paul_K

    Hi,

    I’ve just started using the operant boxes in my new lab and don’t have any experience with the coding. I was wondering if its possible to modify the FR1 program code from the previous user that I’m using into a progressive ratio. Here is the FR1 code:

    \A(0) = FR
    \A(1) = actice Nosepoke
    \A(2) = inactive Nosepoke
    \A(3) = cue light duration
    \A(4) = Timeout Duration
    \A(5) = Nmber of trials to Run
    \A(6) = feeder (3)
    \A(7) = session duration
    \A(8) = pump duration
    \B(0) = resp per ratio
    \B(1) = Total Active Resp per session
    \B(2) = Total InActive Resp per session
    \B(3) = Number of trials completed
    \B(4) = Timer for Cumalative recorder
    \B(5) = Total Act rsp during Timeout
    \B(6) = Total InAct rsp during Timeout
    
     
    
    Dim A = 15
    Dim B = 15
    Dim C = 5000
    \Outputs
    ^ cue light = 1
    ^RightHoleLight = 2
    ^Feeder = 3
    ^Fan = 6
    ^House Light = 7
    ^Pump = 4
    \Inputs
    ^LeftNP = 1
    ^RightNP = 2
    
    s.s.1,
    s1,
    
     
    
    .1":set A(0) = 1; \Ratio
    set A(1) = 1; \Active Nosepoke 1 = left,2 = right
    set A(2) = 2; \InActive Nosepoke 1 = left,2 = right
    set A(3) = 20"; \cue light duration
    set A(4) = 20"; \Timeout duration
    set A(5) = 30; \Number of Trials
    Set A(6) = 3; \Feeder or Pump 3 = feeder, 8 = pump
    Set A(7) = 60'; \Session Duration
    Set A(8) = 3"; \Pump Duration
    On ^Fan--->s2
    s2,
    
     
    
    #START:show 2, Tot InAct Resp,B(2);show 3, Tot Act Resp,B(1);
    show 5, Trial#,B(3)+1--->S3
    
    s3,
    #RA(2):Add B(2);z4;set C(C(0)) = B(4) + .3;add C(0)--->sx
    #RA(1):Add B(0),B(1); set C(C(0)) = B(4) + .1;add C(0);z1;
    If B(0) > A(0)-1[@CompletedRatio,@KeepTrying]
    @CompletedRatio:On A(6),^CueLight;z2;
    set B(0)=0;Add B(3);
    set C(C(0)) = B(4) + .2;add C(0);
    If B(3)>A(5)-1[@EndSession,@Cont]
    @EndSession:--->stopabortflush
    @Cont:show 1,InTimeOut,A(4)/100--->s4
    @KeepTrying:--->sx
    
     
    
    s4, \Timeout
    
     
    
    A(4)#T:clear 1,1;z3--->s3
    #RA(1):Add B(5);show 8,TotTimeoutActive,B(5)--->sx
    #RA(2):Add B(6);show 7,TotTimeoutInActive,B(6)--->sx
    
     
    
    S.S.4, \Turn Feeder or pump off
    
    s1,
    #z2:If A(6) = 3[@TurnFeederOff,@TurnPumpOff]
    @TurnFeederOff:--->s2
    @TurnPumpOff:--->s3
    
     
    
    s2, \Feeder
    .2":off A(6)--->s1
    s3,
    A(8)#T:off A(6)--->s1
    
    S.S.5, \Turn Cuelight off
    
     
    
    s1,
    #z2:--->s2
    
    s2,
    A(3)#T:off ^CueLight--->s1
    
     
    
    S.S.6, \Timer for Cumalative recorder
    s1,
    #start:--->s2
    s2,
    .1":add B(4)--->sx
    #z2:--->s3
    
    s3,
    #z3:--->s2
    
     
    
    S.S.7,
    s1,
    #z1!#z2!#z4:show 2, Tot InAct Resp,B(2);show 3, Tot Act Resp,B(1);
    show 5, Trial#,B(3)+1--->S1
    
     
    
    S.S.8,
    s1,
    #Start:--->s2
    s2,
    A(7)#T:--->stopabortflush
    

    Thanks, Paul.

    #13341
    Med_Support
    Moderator
    Gary Bamberger

    Hi Paul,

    There is a progressive ratio program on our repository:

    https://mednr.com/customer-portal/medstate-notation-repository-landing-page/medstate-notation-repository-programs/

    See if that meets your needs.

     

    I hope that this information helps.
    Gary

    #13344
    Med_Support
    Moderator
    Paul_K

    Hi Gary,

    Our operant boxes have a nosepoke system not levers. Will that make a difference?

    Regards, Paul.

    #13351
    Med_Support
    Moderator
    Gary Bamberger

    Hi Paul,

    When the program looks for an input on #R1 or in this case:

    ^LeftLever = 1
    
    S2,
    #R^LeftLever:
    

     

    It does not care if input 1 is a lever or a nosepoke.  A response on input 1 is all that is required.

    The only thing that might make a difference is if the nosepoke is in Level Mode.  If it is, then you will want to add this code to the program:

    https://mednr.com/med-nr/beam-break-release-detection-v0-1/

    It talks about beam breaks, but will work exactly the same for nose pokes in Level Mode.

     

    I hope that this information helps.
    Gary

    #13449
    Med_Support
    Moderator
    Paul_K

    Hi Gary,

    Since my knowledge of the coding is very limited, is it possible to amend just the FR1 ratio in the attached code to a progressive ratio list and keep everything else the same?

    Regards, Paul.

    #13451
    Med_Support
    Moderator
    Gary Bamberger

    Hi Paul,

    Yes it is possible. Just create a list and draw from it in order using the LIST command. Every time a reward is issued draw the next value from the list.

    Gary

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.