\*************************************************** \ MAIN PROGRAM \*************************************************** S.S.2, S1, \ Draw first Progressive Ratio from List Z #START: LIST P = Z(X) ---> S2 S2, \ Test for Correct Lever #RA(^CorrectLev): ADD B(0), B(1), R; IF R >= P [@PR_Value_Met, @False] @PR_Met: ADD B(3); SET B(6) = P, R = 0; ZA(^RewardDevice) ---> S3 @False: ---> SX #Z^Z_End: ---> S5 S3, \ Wait for End of Reward Signal #Z^Z_End: ---> S5 #Z^Z_EndReward: ---> S4 S4, \ Time Out Interval Following Reward \ Update Progressive Ratio P from LIST Z 0.001”: ON ^houselight, ^leftlight, ^leftleveroperate; A(^TimeOutTicks)#T: LIST P = Z(X) ---> S2 #Z^Z_End: ---> S5 S5, \ End of Session - Turn Lights Off \ Calculate % Correct and % Incorrect 0.01": OFF ^HouseLight, ^LeftLight, ^LeftLever; IF B(0) = 0 [@NoCalc, @Calculate] @NoCalc: ---> S6 @Calculate: SET B(4) = B(1) / B(0) * 100; SET B(5) = B(2) / B(0) * 100; SHOW 7,% Correct,B(4), 8,% Incorrect,B(5), 10,Last PR Met,B(6) ---> S6 S6, \ Holding State at End of Session 1': ---> SX \*************************************************** \ REWARD CONTROL TIMER \*************************************************** S.S.3, S1, #Z^Z_Pellet: ON ^Pellet; OFF ^HouseLight, ^LeftLeverOperate, ^LeftLight ---> S2 60': Z^Z_End ---> STOPABORTFLUSH \end if no reward received in 60 minutes S2, \ Time Reward Device for A(^RewardTime) seconds \ Default value set in S.S.1, S1 & S2 A(^RewardTicks)#T: OFF ^PelletZ^Z_EndReward ---> S1