Fixed ratio help

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #16966
    Mason Hochstetler
    Participant

    Hi there I am relatively new to using med pc and have been writing code for an FR program using the tutorial book as a guide.
    I have been struggling to figure out why my code will only record one reward and stop recording or producing new rewards in the chamber. I also wanted to see how I can setup a timeout period where responses can be recorded separate from the active response and no reward is given. any help would be appreciated, I have my code so far here

    \outputs legend
    ^Righthouselight = 6
    ^Lefthouselight = 7
    ^Vaporpump = 3 \Reinforcer
    \-------------------------------------------------------
    VAR_ALIAS Session Time                  = M \ Default = 60 minutes
    VAR_ALIAS Maximum number of reinforcers = N \ Default = 200
                                                \ allows to set variables at beginning,
                                                \ alternatively can sessions ---> change variables
    \-------------------------------------------------------
    \input Legend
    \^right nose poke (inactive for the time being)
    ^leftnosepoke = 2
    \-------------------------------------------------------
    \ variables Legend
    \ C() = IRT Data Array
    \ F = fixed ratio value (FR)
    \ I = Index into IRT Data Array C
    \ L = left nosepoke counter (counts number of nose pokes)
    \ M = max session time (minutes)
    \ N = Max number of reinforcers (Vapor pump)
    \ R = Reinforcer counter (counts number of nose pokes)
    \ S = session timer (minutes)
    \ T = IRT Timer
    \ O = Timeout counter
    \-------------------------------------------------------
    
    DIM C = 999
    
    PRINTORIENTATION = LANDSCAPE
    PRINTCOLUMNS = 4
    PRINTOPTIONS = FULLHEADERS, FORMFEEDS
    PRINTVARS = C, L, R
    
    \-------------------------------------------------------
    s.s.1, \Main control logic for FR
    s1,
    0.01": SET F = 1, M = 60, N = 200 ---> s2 \Values plugged into variables
    \see VARIABLES above
    \can be edited to fit needs
    
    s2,
    #start: ON ^lefthouselight ---> s3
    
    s3, \ Reinforcer counter and display
    \ Z-pulse (z1) acting as an output
    F#R^Leftnosepoke: ADD R; SHOW 3, Vapor infusions ,R;  z1 ---> s4
    s4,
    0.01": OFF ^lefthouselight, ^leftnosepoke ---> S5
    #R^leftnosepoke: ADD O; SHOW 4, Timeout Responses, O; ---> sx
    s5,
    60": ON ^leftnosepoke, ^lefthouselight,  ---> sx
    #Z32: ---> S1
    \-------------------------------------------------------
    s.s.2, \ Response counter and display
    s1, \ this will put label the left responses
    \ and its value L on the screen after
    \start is issued
    #START: SHOW 2, Active responses, L ---> s2 \active nose is the left
    s2,
    F#R^leftnosepoke: ADD L; Show 2, Active Responses, L ---> sx \active is the left
    #Z32: ---> S1
    \-------------------------------------------------------
    s.s.3,
    \Amount of time the pump will remain on before turning off
    s1, \z pulse acting as an input
    #z1: ON ^vaporpump ---> s2
    s2,
    3": OFF ^vaporpump --->s1
    \-------------------------------------------------------
    s.s.4, \Increment Time (T) in 0.01 second intervals
    s1,
    #START: ---> s2
    s2,
    0.01": SET T = T + 0.01 ---> sx
    #Z32: ---> s1
    \-------------------------------------------------------
    s.s.5, \Recording IRT's (Inter-response time)
    s1,
    #START: ---> s2
    s2,
    #R^leftnosepoke: IF I > 999 [@ArrayFull, @Continue]
     @Full: ---> S1
     @Cont: SET C(I) = T, T = 0; ADD I;
     IF I > 999 [@ArrayFull, @SealArray]
     @Full: ---> S1
     @Seal: SET C(I) = -987.987 ---> SX
    #Z32: ---> s1
    \-------------------------------------------------------
    
    s.s.6, \session timer & Max reinforcer limiter
    s1,
    #start: SHOW 1, session minutes,s/60 ---> s2
    
    s2,
    0.01": SET S = S + 0.01;
    SHOW 1, Session Minutes,S/60; \check session time
    IF (s/60 >= M) OR (R >= N) [@True, @False] \if session timer or number of responses
    \hits their max the program will shut down and save.
    @True: Z32 ---> S3
    @false: ---> SX
    
    s3,
    2": ---> stopsave
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.