\ This is a Progressive Ratio \ Filename, PR.mpc \ Written by Maartje Rijkens \ Date March 7, 2005 \ \ Gary Bamberger \ Updated Code: September 25, 2009 \ Inputs ^LeftLever = 1 ^RightLever = 2 ^NosePoke = 3 \ Outputs ^Fan = 3 ^LeftCue = 5 ^HouseLight = 7 ^Reward = 8 \ In this code, this is a Syringe Pump \ List Data Variables Here \ A = Total Number of Responses on Correct Lever \ B = Total Number of Responses on Incorrect Lever \ C = Total Number of Rewards Given \ D = Total Number of NosePokes \ E = Array of Response Times on Correct Lever \ F = Array of Response Times on Incorrect Lever \ G = Array of Times when Rewards were Dispensed \ H = Array of Response Times for NosePoke Hole \ List Working Variables Here \ N = Session Timer \ R = Index into List D \ X = Fixed Ratio Drawn from List D \ Z = Progressive Ratio Array DIM E = 100000 DIM F = 100000 DIM G = 29 DIM H = 100000 LIST Z = 1, 2, 4, 9, 12, 15, 20, 25, 32, 40, 50, 62, 77, 95, 118, 145, 178, 219, 268, 328, 402, 492, 603, 737, 901, 1102, 1347, 1647, 2012 \ LIST Z was derived from the following equation: \ [ (injection number * 0.2)] \ Response ratio = [5e ] - 5 (Richardson and Roberts, 1996) \ Z-Pulses Used in this Program \ Z1 = Reward Signal S.S.1, \ Main Control Logic for "PR" S1, #START: ON ^HouseLight, ^LeftLever, ^RightLever, ^Fan ---> S2 S2, 0.01": LIST X = Z(R); SHOW 2,PR =,X ---> S3 S3, X#R^LeftLever: OFF ^HouseLight, ^LeftLever, ^RightLever; Z1 ---> S4 60': OFF ^HouseLight, ^LeftLever, ^RightLever ---> STOPABORTFLUSH S4, 10': ON ^HouseLight, ^LeftLever, ^RightLever ---> S2 S.S.2, \ Response Counter for the Correct Lever S1, #START: SHOW 3,Correct Resp,A; SET E(A) = -987.987 ---> S2 S2, #R^LeftLever: ADD A; SHOW 3,Correct Resp,A; SET E(A) = N, E(A+1) = -987.987 ---> S2 S.S.3, \ Response Counter for the Incorrect Lever S1, #START: SHOW 4,Incorrect Resp,B; SET F(B) = -987.987 ---> S2 S2, #R^RightLever: ADD B; SHOW 4,Incorrect Resp,B; SET F(B) = N, F(B+1) = -987.987 ---> S2 S.S.4, \ Reward Counter and Timer S1, #START: SHOW 5,Rewards,C; SET G(C) = -987.987 ---> S2 S2, #Z1: ON ^Reward, ^LeftCue; ADD C; SHOW 5,Rewards,C; SET G(C) = N, G(C+1) = -987.987 ---> S3 S3, 5.6": OFF ^Reward, ^LeftCue; IF C >= 29 [@MaxRewards, @Cont] @Max: ---> STOPABORTFLUSH @Cont: ---> S2 S.S.5, \ Nosepoke Counter S1, #START: SHOW 6,Nosepoke,D; SET H(D) = -987.987 ---> S2 S2, #R^NosePoke: ADD D; SHOW 6,Nosepoke,D; SET H(D) = N, H(D+1) = -987.987 ---> S2 S.S.6, \ Session Timer S1, #START: SHOW 1,Session,N/60 ---> S2 S2, 0.01": SET N = N + 0.01; SHOW 1,Session,N/60 ---> S2