DRL-4s

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #13517
    Med_Support
    Moderator
    mama6600

    I’m trying to write a DRL-4s program but i got stuck from the reset timer and reward. Would anyone have suggestion for that?

    #13516
    Med_Support
    Moderator
    Gary Bamberger

    Hello,

    It is very hard to make a suggestion without seeing the code that you have written.  Here is a possibility that might work for you:

    S.S.2,
    S1,
    #START: ---> S2
    
    S2,
    4#R1: ---> S2            \ If we receive 4 responses before the timer runs out, restart the timer
    4": ON ^Pellet ---> S3  \ If 4s passes with less than 4 responses, issue reinforcement
    
    S3,
    0.05": OFF ^Pellet ---> S2
    
    #13520
    Med_Support
    Moderator
    mama6600
    S.S.2, \reset timer
    
    S1,
    #R^Leftlever: SET T = 0; Z2 ---> S2
    
    S2,
    0.01": SET T = T +0.1 ---> SX
    
    S.S.3, \If lever press occur at or passes over 4s, it will gain reward. If lever press occur before 4s, the lever press will reset the time to zero
    
    S1,
    #R^leftlever: IF T >= 4 (@True, @False)
    @Ture: ON ^Reward ---> S2
    @False: Z2 ---> SX
    
    S2,
    4" : OFF ^Reward ---> SX
    

     

    The problem is how to write a script which is describing: “If lever press occur at or passes over 4s, gain reward. If every single lever press occur before 4s (0s-3.9s), the certain lever press will reset the time to zero”.

    #13524
    Med_Support
    Moderator
    Gary Bamberger

    It looks like my original code was very close. I think this might do what you want:

    S.S.2,
    S1,
      #START: ---> S2
    
    S2,
      #R^LeftLever: ---> S2  \ If we receive a responses before the timer runs out, restart the timer
      3.99":        ---> S3  \ If 3.99s passes, then reward the next lever press
    
    S3,
      #R^LeftLever: ON ^Reward ---> S4  \ 3.99 + 0.01 = 4.00s  so any response will be at 4s or later
    
    S4,
      4": OFF ^Reward ---> S2  \ After reward go back for the next 4s interval
    
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.