\SUCROSE TRAINING SESSIONS \FR1 SCHEDULE \ADAPTED BY MJFR DEC 2012 - UPDATED SEPT 2013 \UPDATED BY AJR/UofM LSAIT AUG 2015 \--INPUTS: ^MAGAZINE = 5 \ Remaining inputs are set with variable I (see below) \--OUTPUTS: ^LASER=15 ^HOUSELIGHT=11 ^WHITENOISE=14 ^TONE=13 ^PUMP=12 ^SUCROSE=9 VAR_ALIAS Active Poke (FF:1 FN:2 BF:3 BN:4) = I(0) VAR_ALIAS Use Laser? (Yes: 1 No: 0) = I(1) VAR_ALIAS Noise Cue (Tone: 1 White Noise: 0) = I(2) VAR_ALIAS Max Sucrose Rewards = B(4) VAR_ALIAS Inactive Time Following Reward (seconds) = S VAR_ALIAS Retract Pokes When Inactive? (Yes: 1 No: 0) = I(3) VAR_ALIAS Session Duration (minutes) = B(1) VAR_ALIAS Data Block Length (seconds) = B(2) VAR_ALIAS Pellets Per Sucrose Reward = B(8) VAR_ALIAS Response Ratio = X DIM A = 10 \TIMERS: \A(0) - Counts seconds before starting test \A(1) - \A(2) - \A(3) - \A(4) - Block counter used in S.S.18 \A(5) - \A(6) - \A(7) - Count session duration in minutes \A(8) - \A(9) - DIM B = 14 \SET SESSION PARAMETERS IN S.S.1 \B(0) - Time in seconds before session starts \B(1) - Session duration in minutes \B(2) - Data block time in minutes \B(3) - \B(4) - Max sucrose \B(5) - Sucrose count \B(8) - Pellets per sucrose reward \B(9) - Pellet counter for each reward DIM C = 4 \REWARD COUNT \(0) - Updated when Q = 0 or 5 (Total rewards), session total \(1) - Updated when Q = 0 (Rewards during forced choice), session total \(2) - Updated when Q = 5 (Rewards during free choice, session total \(3) - Updated when Q = 0 or 5 (Block rewards), reset by block DIM E = 12 \RESPONSE COUNTER \SESSION TOTAL: \(0) - Updated when Q = 0 or 5 (active) \(1) - Updated when Q = 0 (active, forced choice--not used here) \(2) - Updated when Q = 5 (active, free choice) \(3) - Updated when Q = 1, 2, 3, or 4 (inactive) \(4) - Updated when Q = 1 or 2 (inactive, forced choice--not used here) \(5) - Updated when Q = 3 or 4 (inactive, free choice) \RESET BY BLOCK: \(6) - Updated when Q = 0 or 5 (active) \(7) - Updated when Q = 0 (active, forced choice--not used here) \(8) - Updated when Q = 5 (active, free choice) \(9) - Updated when Q = 1, 2, 3, or 4 (inactive) \(10) - Updated when Q = 1 or 2 (inactive, forced choice--not used here) \(11) - Updated when Q = 3 or 4 (inactive, free choice) DIM G = 3 \MAGAZINE ENTRY COUNTER \G(0) - Total magazine entries \G(1) - Entries this time block DIM I = 3 \SETTINGS: \I(0) - Input number of active poke \I(1) - Laser: 1 to use laser, 0 for no laser \I(2) - Noise cue: 1 for tone, 0 (or anything else) for white noise \I(3) - Retract pokes during inactive state? 1 for yes, 0 (or anything else) for no \In output arrays J, K, L, P the first element is the total count for \ the session; the following elements are the counts per block. DIM J = 121 \ARRAY FOR REWARDS DIM K = 121 \ARRAY FOR ACTIVE RESPONSES DIM L = 121 \ARRAY FOR INACTIVE RESPONSES DIM P = 121 \ARRAY FOR MAGAZINE ENTRIES \S is the inactive period following a reward DIM V = 4 \OUTPUT SETTINGS \V(0) - Active poke output \V(1-3) - Inactive poke outputs \X = Current response ratio DIM Q = 2 \Q(0) - Tracks current state \ 3 - (Inactive) Hold period following infusion \ 5 - (Active) Waiting for press outside of hold period, free choice \Q(1) - Tracks whether an active response occurred, changing Q(0) \ (This is so there's a way to count the response that triggers the reward \ as an active response, even though the Q value has changed.) \Y = INDEX FOR DATA COLLECTION IN ARRAYS J,K,L - S.S.18 \Z PULSES: \ Z1 - Sent start Free Choice \ Z2 - Sent to trigger infusion \ Z10 - Sent to start program after setup delay, S.S.2 \ Z19 - Sent to turn on tone (goes to S.S.19) \ Z20 - Sent to trun on white noise (goes to S.S.19) \ Z21 - Sent to turn on laser (goes to S.S.21) \ Z25 - Sent when A(7) == B(1) (session duration reached), S.S.15 \ or when B(5) == B(4) (max infusions reached), S.S.16 \********************************************************************* \ SET SESSION PARAMETERS \********************************************************************* S.S.1, S1, 1": SET B(0)=5; \TIME BEFORE SESSION 1 in seconds SET B(1)=60; \SESSION DURATION--MIN SET B(2)=300; \DATA BLOCK TIME-SECONDS--DEFAULT IS 5 MINUTES SET B(3)=0; \DETERMINANT FOR ORDER OF FORCED CHOICE SESSION SET B(4)=50; \MAX INFUSIONS SET B(5)=0; \INFUSION COUNTER SET B(8)=1; \1 PELLET PER SUCROSE REWARD SET X=1; \RESPONSE RATIO = 1 SET S=20; \DEFAULT INACTIVE TIME IS 20 SECONDS SET I(3)=0; \DEFAULT TO NOT RETRACTING NOSE POKES SET I(0)=1; \DEFAULT ACTIVE INPUT IS 1 SET I(1)=1; \DEFAULT IS TO USE THE LASER SET I(2)=1 --->S2 \DEFAULT NOISE CUE IS TONE S2, 1500':--->S2 \********************************************************************* \ TIMER FOR SESSION START - A(0) \********************************************************************* S.S.2, S1, #START:--->S2 S2, 0": SET S = S * 1"; \ Convert timeout time to seconds \Set outputs to advance the active nose poke and retract/turn off other pokes IF I(0) = 1 [@Out1, @No1] @Out1: SET V(0) = 1, V(1) = 3, V(2) = 5, V(3) = 7 ---> S4 @No1: IF I(0) = 2 [@Out2, @No2] @Out2: SET V(0) = 3, V(1) = 1, V(2) = 5, V(3) = 7 ---> S4 @No2: IF I(0) = 3 [@Out3, @No3] @Out3: SET V(0) = 5, V(1) = 1, V(2) = 3, V(3) = 7 ---> S4 @No3: SET V(0) = 7, V(1) = 1, V(2) = 3, V(3) = 5 ---> S4 \Assume if it's not 1, 2, or 3, it must be 4. S4, 1": ADD A(0); IF A(0)=B(0) [@T,@F] @T:--->S5 @F:--->SX S5, 1": Z1--->S6 S6, 1500':--->STOPABORT \********************************************************************* \ START CHOICE SESSION \********************************************************************* S.S.6, S1, #Z1: --->S2 S2, 5": ON ^HOUSELIGHT, V(0); OFF V(1), V(2), V(3); SET Q(0) = 5---> S4 S4, X#RI(0): ADD B(5); Z2; SET Q(0) = 3, Q(1) = 1; IF I(1) = 1 [@Laser, @NoLaser] @Laser: Z21 --->S5 @NoLaser: --->S5 S5, 0": IF I(3) = 1 [@Retract, @NoRetract] @Retract: OFF V(0) ---> S6 @NoRetract: ---> S6 S6, 0": IF I(2) = 1 [@Tone, @Noise] \If the active poke is the tone poke, @Tone: Z19---> S10 \ play a tone. @Noise: Z20---> S10 \ Otherwise play white noise. S10, S#T: SET Q(0) = 5; ON V(0) --->S4 #Z25:--->S1 \*************************************************** \ LASER TRIGGER \*************************************************** S.S.21, S1, #Z21: ON ^LASER --->S2 S2, 0.1": OFF ^LASER --->S1 \*************************************************** \ SUCROSE TRIGGER \*************************************************** S.S.7, S1, #Z2: SET B(9) = 0 ---> S2 S2, 0": IF B(9) < B(8) [@DispensePellet, @Done] @DispensePellet: ADD B(9); ON ^SUCROSE ---> S3 @Done: ---> S1 S3, 0.5": OFF ^SUCROSE --->S2 \*************************************************** \ TONE TRIGGER \*************************************************** S.S.19, S1, #Z19: ON ^TONE --->S2 S2, 8": OFF ^TONE --->S1 \*************************************************** \ WHITE NOISE TRIGGER \*************************************************** S.S.20, S1, #Z20: ON ^WHITENOISE --->S2 S2, 8": OFF ^WHITENOISE --->S1 \********************************************************************* \ COUNTERS \********************************************************************* \**************REWARD COUNTER************* S.S.8, S1, #Z10 ! #Z1 --->S2 S2, #Z2: ADD C(0), C(2), C(3) --->S2 #Z25:--->S1 \**************RESPONSE COUNT************ S.S.10, S1, #Z10 ! #Z1 --->S2 S2, #RI(0): IF (Q(0) = 5) OR (Q(1) = 1) [@TRUE,@FALSE] @TRUE: SET Q(1) = 0; ADD E(0), E(2), E(6), E(8) --->S2 \ ACTIVE RESPONSE @FALSE:ADD E(3), E(5), E(9), E(11) --->S2 \ INACTIVE RESPONSE #Z25:--->S1 \******* MAGAZINE RESPONSE COUNTER AND ITI-MAG************ S.S.12, S1, #Z10 ! #Z1--->S2 S2, #R^MAGAZINE: ADD G(0), G(1) ---> SX #Z25:--->S1 \********************************************************************* \ SHOW COMMANDS \********************************************************************* S.S.14, S1, #Z10 ! #Z1: --->S2 S2, 0.1": SHOW 1, Sucrose Rewards, C(0); SHOW 2, Active Responses, E(0); SHOW 3, Inactive Responses, E(3); SHOW 6, Magazine Entries, G(0); SHOW 11, Current Response Ratio, X; SHOW 12, Q Value, Q(0) ---> SX \********************************************************************* \ SESSION TIMER \********************************************************************* S.S.15, S1, #Z10 ! #Z1: --->S2 S2, 1': ADD A(7); SHOW 5, Session Runtime (minutes),A(7); IF A(7)=B(1) [@T,@F] @T:--->S3 @F:--->S2 S3, 1": OFF ^HOUSELIGHT,^TONE,^WHITENOISE,V(0);Z25--->S4 S4, 1":--->STOPABORTFLUSH \********************************************************************* \ SUCROSE COUNTER \********************************************************************* S.S.16, S1, #Z10 ! #Z1: --->S2 S2, 0.1": IF B(5)=B(4) [@T,@F] @T:--->S3 @F:--->S2 S3, 1": OFF ^HOUSELIGHT,V(0);Z25--->S4 S4, 1":--->STOPABORTFLUSH \******************************************************************************************************************** \ COLLECTION FOR REWARDS (J/C) AND RESPONSES (Active K/E(0) & Inactive L/E(3)), MAGAZINE ENTRIES (G/P) \******************************************************************************************************************** S.S.18, S1, #Z10 ! #Z1: SET Y=1--->S2 S2, 1":ADD A(4); IF A(4)=B(2) [@T,@F] @T:--->S3 @F:--->SX #Z25:SET A(4)=0--->S3 \Make sure the last block gets updated. S3, 0": SET J(0) = C(0); \Update total SET J(Y) = C(3); \Save block total SET K(0) = E(0); SET K(Y) = E(6); SET L(0) = E(3); SET L(Y) = E(9); SET P(0) = G(0); SET P(Y) = G(1); ADD Y; SET J(Y) = -987.987; \Seal the arrays so we don't get a bunch of extra data points SET K(Y) = -987.987; SET L(Y) = -987.987; SET P(Y) = -987.987; \RESET BLOCK TOTALS SET C(3)=0, G(1)=0; SET E(6)=0,E(7)=0,E(8)=0,E(9)=0,E(10)=0,E(11)=0; IF A(4)=0 [@True, @False] @True:--->S1 @False:--->S4 S4, 0": SET A(4)=0 --->S2