Delay reward with nose-poking
MEDState Notation Repository › Forums › Coding Help Archive › Delay reward with nose-poking
- This topic has 11 replies, 5 voices, and was last updated 6 years, 11 months ago by
Lidia.
-
AuthorPosts
-
June 5, 2018 at 8:54 am #14457
Nathalie Ginovart
ParticipantHi,
We are trying to modify the DelayedReward_v2 program from the repository to use nose-poking instead of lever-pressing for the delayed and immediate reward.We are struggling for a while with the coding and still we cannot make it work. As we are not very familiar with coding, we would very much appreciate your help.
Many thanks for your time and help !
Nathalie
June 5, 2018 at 11:33 am #14458Gary Bamberger
ModeratorHi Nathalie,
I don’t have enough information to be able to help. Probably the best thing would be for you to email support@med-associates.com with a copy of the changes that you have made and a description of how you want it to work. We can then help.
Gary
July 18, 2018 at 9:54 am #14786Bastiaan
ParticipantHi Nathalie,
I would like to enquire if you have been able to get the Delayed reward program to work.
If so, would you be able to share this code?Many thanks!
Bastiaan
July 18, 2018 at 10:25 am #14787Gary Bamberger
ModeratorThe program has been sent to you.
Please let me know if we can help in any other way.
Best,
GaryJuly 19, 2018 at 4:47 am #14791Bastiaan
ParticipantHi Gary,
This would be extremely helpfull, do you need my email adress?
Many thanks indeed,
Bastiaan van der Veen
July 19, 2018 at 11:04 am #14792Gary Bamberger
ModeratorThe program was sent to the email that you provided when signing up. Please let me know if you didn’t receive it.
Gary
July 19, 2018 at 11:10 am #14793Bastiaan
ParticipantI have not received the program in my email.
However notifications about replies are received normally.Bas
May 7, 2019 at 7:06 am #15454Lidia
ParticipantHello !
I’ve tried to modify the mpc code because the original one is made for lever-pressing and I’m working with nose-poking.
The problem is that in the forced trials (when only one hole is illuminated), if the animal nose-pokes in the illuminated it will received the reward (as expected) but if it does it in the non-illuminated hole it will receive the reward as well. As the levers extend-retract, the animal can only respond in one of the levers but in the case of the nose-pokes, the animal has both available and he has to learn to nose-poke to the illuminated and if it does respond in the non-illuminated, should not have any consequence at any time.
Please find attached the mpc code we are working on. We just need that in the 2 initial forced trials the non-illuminated hole should not give any reward.
Thank you very much !!!
\ Copyright (c) 2011 MEDState Notation Repository, All rights reserved.
\ Delayed Reward_v2.mpc
\
\ After ITI the House Light and Stim Light are turned on. Animal is given a
\ specified amount of time to respond with a nose poke. If no response, a Type
\ 1 Omission is recorded.
\
\ If there is a response, then for the forced trials either the Immediate or the
\ Delayed lever is presented alternatingly and the Stim Light is turned off.
\ If this is a free choice trial, then both levers are presented. If there is
\ no lever press within the specified time, then a Type 2 Omission is recorded.
\
\ If the Delayed lever is chosen then the lever(s) are retracted, the House
\ Light is turned off, the large reward is given and the Stim Light is turned on
\ after the delay. If there is no nose poke in the pellet tray within the
\ specified time, then a Type 3 Omission is recorded.
\
\ If the Immediate lever is chosen then the lever(s) are retracted, the Stim
\ Light is turned on, House Light is turned off, and 1 pellet is given. There
\ is no delay before the reward when the Immediate lever is chosen. If there is
\ no nose poke in the pellet tray within the specified time, then a Type 4
\ Omission is recorded.
\
\ The program will start with the specified number of forced trials and then the
\ rest of the trials in the block will be free choice trials. When the number
\ of trials per block have been reached the program will draw a new delay to the
\ large reward from LIST N. When all trial blocks have been completed the
\ program will end.
\
\ SoftCR data is saved in Array C in Relative Mode with a 10ms Resolution.\ Inputs
^LeftLeverIn = 3
^RightLeverIn = 8
^Nosepoke = 6 \ Level Mode\ Outputs
^StimLight = 6
^HouseLight = 7
^Pellet = 8
^LeftLeverOut = 15
^RightLeverOut = 16\ A() = Control Variables with Assigned Aliases as Defined
Var_Alias New Trial Interval (sec) = A(0) \ Default = 100 seconds
Var_Alias Response Time (sec) = A(1) \ Default = 10 seconds
Var_Alias Immediate Reward Nose Poke (3=Left 8=Right) = A(2) \ Default = 3-Left
Var_Alias Delayed Reward Nose Poke (3=Left 8=Right) = A(3) \ Default = 8-Right
Var_Alias Number of Pellets for Delayed Rewards = A(4) \ Default = 4
Var_Alias Number of Blocks to Run = A(5) \ Default = 5
Var_Alias Number of Forced Trials (Should be an Even #) = A(6) \ Default = 2
Var_Alias Number of Trials per Block = A(7) \ Default = 12
Var_Alias SoftCR Data Array (1=Yes 0=No) = A(8) \ Default = 1^NTI = 0
^ResponseTime = 1
^ImmediateLever = 2
^DelayedLever = 3
^LargeReward = 4
^NumBlocks = 5
^ForcedTrials = 6
^TrialsPerBlock = 7
^SoftCR = 8
^NTITicks = 9
^ResponseTicks = 10\ List Data Variables Here
\ B() = Experiment Totals
\ B(0) = Not Used
\ B(1) = Total Pellets Delivered
\ B(2) = Total Immediate Lever Responses
\ B(3) = Total Delayed Lever Responses
\ B(4) = Total Successful Trials
\ B(5) = Total Nose Poke Omissions (Type 1)
\ B(6) = Total Lever Omissions (Type 2)
\ B(7) = Total Delayed Reward Omissions (Type 3)
\ B(8) = Total Immediate Reward Omissions (Type 4)
\
\ C() = SoftCR Array
\
\ D() = Trial by Trial Data
\ D(J) = Trial Number in this Block
\ D(J+1) = Number of Pellets Delivered this Trial
\ D(J+2) = Lever Chosen (1=Immediate, 2=Delayed)
\ D(J+3) = Omission Type (1, 2, 3, or 4)
\ D(J+4) = Trial Completed Successfully (1=Yes, 0=No)
\ D(J+5) = Latency to Initial Nose Poke
\ D(J+6) = Latency to Lever Press
\ D(J+7) = Latency to Final Nose Poke
\ D(J+8) = Delay Time to Reward
\
\ E() = Block by Block Data
\ E(K) = Block Number
\ E(K+1) = Number of Pellets Delivered this Block
\ E(K+2) = Number of Immediate Lever Responses this Block
\ E(K+3) = Number of Delayed Lever Responses this Block
\ E(K+4) = Number of Successful Trials this Block
\ E(K+5) = Number of Nose Poke Omissions (Type 1) this Block
\ E(K+6) = Number of Lever Omissions (Type 2) this Block
\ E(K+7) = Number of Delayed Reward Omissions (Type 3) this Block
\ E(K+8) = Number of Immediate Reward Omissions (Type 4) this Block\ List Working Variables Here
\ F = Counter for Nose Poke Level Inputs
\ G = List for selecting the Forced Trial Type
\ H = Forced Trial Type (Immediate or Delayed) drawn from List G
\ I = Subscript for the SoftCR Array C
\ J = Subscript into the Trial Array D
\ K = Subscript into the Block Array E
\ L = Block Number
\ M = Trial Number this Block
\ N = List of Delay Times
\ O = Nose Poke Latency Timer
\ P = Lever Latency Timer
\ Q = Number of Pellets to Deliver
\ R = Number of Rewards Delivered
\ S = Subscript into List N
\ T = Elapsed Time in 0.01 sec increments for SoftCR Data
\ U = Delay Time that was drawn from List NLIST G = 1, 2 \ Forced Trial Type
LIST N = 0″, 10″, 20″, 40″, 60″ \ List of Delay TimesDIM A = 10
DIM B = 8
DIM C = 100000 \ Dimension Array C for 100,001 data points.
\ Under MED-PC Version IV, this array may be
\ enlarged up to 1 million elements; however,
\ 100,001 was felt to be adequate for this application.
\ An end of array seal -987.987 will limit the saved
\ file to only those elements used during the running
\ of the procedure.
DIM D = 50000
DIM E = 1000\ Z-Pulses Used in this Program
^Z_Pellet = 1 \ Signal Pellet Delivery
^Z_NPLat = 2 \ Signal Start of Nose Poke Latency Counter
^Z_LeverLat = 3 \ Signal Start of Lever Latency Counter
^Z_LatEnd = 4 \ Signal End of Latency Counters
^Z_PelletEnd = 5 \ Signal End of Pellet Deliveries
^Z_NewTrial = 6 \ Signal New Trial
^Z_CorrectResp = 7 \ Signal a Step or Correct Response
^Z_Reward = 8 \ Signal a Pip or Reward Issued
^Z_Type1 = 9 \ Signal a Event 0 or Type 1 Omission
^Z_Type2 = 10 \ Signal a Event 1 or Type 2 Omission
^Z_Type3 = 11 \ Signal a Event 2 or Type 3 Omission
^Z_Type4 = 12 \ Signal a Event 3 or Type 4 Omission
^Z_NPBreak = 13 \ Signal Completed Nose Poke Break
^Z_NPRelease = 14 \ Signal Nose Poke WithdrawalDISKCOLUMNS = 9
DISKFORMAT = 10.2
DISKVARS = A, B, C, D, E\***************************************************
\ DELAYED REWARD_V2 SCHEDULE
\ S1 – Set Default Values
\ New Trial Interval (100 sec)
\ Response Time (10 sec)
\ Immediate Reward Nose Poke (3-Left)
\ Delayed Reward Nose Poke (8-Right)
\ Number of Pellets for Delayed Rewards (4)
\ Number of Blocks to Run (5)
\ Number of Forced Trials (2)
\ Number of Trials per Block (12)
\ SoftCR Data Array (1-Yes)
\***************************************************
S.S.1,
S1,
0.01″: SET A(^NTI) = 100, A(^ResponseTime) = 10, A(^ImmediateLever) = 3;
SET A(^DelayedLever) = 8, A(^LargeReward) = 4, A(^NumBlocks) = 5;
SET A(^ForcedTrials) = 2, A(^TrialsPerBlock) = 12, A(^SoftCR) = 1 —> S2S2, \ First Statement: Wait for START signal, initialize the Trial
\ number and the Block number, and transition to ITI.
\
\ Second Statement: Update screen display with default values
\ for control variables. This will show any changes made via
\ the Configure | Change Variables window prior to START.
#START: CLEAR 1,60; SET L = 1, M = 1;
RANDD H = G; LIST U = N(S);
SET D(J+9) = -987.987, E(K+9) = -987.987;
SET A(^NTITicks) = A(^NTI) * 1″;
SET A(^ResponseTicks) = A(^ResponseTime) * 1″ —> S3
1″: SHOW 1,New Trial Int,A(^NTI), 2,Response Time,A(^ResponseTime), 3,Immediate Lever,A(^ImmediateLever);
SHOW 4,Delayed Lever,A(^DelayedLever), 5,# of Pellets,A(^LargeReward), 6,# of Blocks,A(^NumBlocks);
SHOW 7,Forced Trials,A(^ForcedTrials), 8,Trials/Block,A(^TrialsPerBlock), 9,SoftCR Code,A(^SoftCR) —> SXS3, \ Time Initial ITI. Signal start of Nose Poke Latency counter.
#Z^Z_NewTrial: ON ^HouseLight, ^StimLight;
SET E(K) = L, D(J) = M;
Z^Z_NPLat —> S4S4, \ If Nose Poke is made within allotted time, turn off
\ the Stim Light and extend only one lever if a
\ forced trial or both levers if a free choice trial.
\ Signal start of Lever Latency counter.
\
\ If Timeout, record Type 1 Omission.
#Z^Z_NPBreak: OFF ^StimLight; SET D(J+5) = O;
Z^Z_LeverLat; Z^Z_LatEnd; Z^Z_CorrectResp;
IF M > A(^ForcedTrials) [@Free, @Forced]
@Free: ON ^LeftLeverOut, ^RightLeverOut —> S5
@Forced: IF H = 1 [@Immediate, @Delayed]
@Immediate: IF A(^ImmediateLever) = ^LeftLeverIn [@Left, @Right]
@Left: ON ^LeftLeverOut —> S5
@Right: OFF ^RightLeverOut —> S5
@Delayed: IF A(^DelayedLever) = ^LeftLeverIn [@Left, @Right]
@Left: OFF ^LeftLeverOut —> S5
@Right: ON ^RightLeverOut —> S5
A(^ResponseTicks)#T: OFF ^HouseLight, ^StimLight;
ADD B(5), E(K+5);
SET D(J+3) = 1, D(J+5) = O;
Z^Z_LatEnd; Z^Z_Type1 —> S10S5, \ If Lever response is made within allotted time, turn off
\ the House Light, retracts the levers. Signal to issue
\ immediate rewards.
\
\ If Timeout, record Type 2 Omission.
#RA(^ImmediateLever): ADD B(2), E(K+2); ON ^StimLight;
OFF ^HouseLight, ^LeftLeverOut, ^RightLeverOut;
SET D(J+2) = 1, D(J+6) = P, Q = 1;
Z^Z_Pellet; Z^Z_NPLat;
Z^Z_LatEnd; Z^Z_CorrectResp —> S6
#RA(^DelayedLever): ADD B(3), E(K+3);
ON ^HouseLight, ^RightLeverOut; OFF ^LeftLeverOut;
SET D(J+2) = 2, D(J+6) = P, Q = A(^LargeReward);
Z^Z_LatEnd; Z^Z_CorrectResp —> S7
A(^ResponseTicks)#T: OFF ^HouseLight, ^LeftLeverOut, ^RightLeverOut;
ADD B(6), E(K+6);
SET D(J+3) = 2, D(J+6) = P;
Z^Z_LatEnd; Z^Z_Type2 —> S10S6, \ Immediate Reward Lever chosen. If Nose Poke detected
\ record latency.
\
\ If timeout record Type 4 Omission.
#Z^Z_NPBreak: OFF ^HouseLight, ^StimLight;
ADD B(4), D(J+4), E(K+4);
SET D(J+7) = O;
Z^Z_LatEnd; Z^Z_CorrectResp —> S10
A(^ResponseTicks)#T: OFF ^HouseLight, ^StimLight;
ADD B(8), E(K+8);
SET D(J+3) = 4, D(J+7) = O;
Z^Z_LatEnd; Z^Z_Type4 —> S10S7, \ Delayed Reward Lever chosen. Wait until delay time
\ has elapsed, signal for the large reward to be
\ issued, and turn on the Stim Light.
U#T: OFF ^HouseLight, ^RightLeverOut; ON ^StimLight; SET D(J+8) = U;
Z^Z_Pellet; Z^Z_NPLat —> S8S8, \ If Nose Poke detected record latency. If Z^Z_PelletEnd
\ pulse arrives, last pellet has been issued, begin timer.
#Z^Z_NPBreak: OFF ^HouseLight, ^StimLight;
ADD B(4), D(J+4), E(K+4);
SET D(J+7) = O;
Z^Z_LatEnd; Z^Z_CorrectResp —> S10
#Z^Z_PelletEnd: —> S9S9, \ If Nose Poke detected record latency.
\
\ If timeout record Type 3 Omission.
#Z^Z_NPBreak: OFF ^HouseLight, ^StimLight;
ADD B(4), D(J+4), E(K+4);
SET D(J+7) = O;
Z^Z_LatEnd; Z^Z_CorrectResp —> S10
A(^ResponseTicks)#T: OFF ^HouseLight, ^StimLight;
ADD B(7), E(K+7);
SET D(J+3) = 3, D(J+7) = O;
Z^Z_LatEnd; Z^Z_Type3 —> S10S10, \ Wait for New Trial Signal. Increment trial number.
\ Select next lever for forced trials. If this is the
\ 12th trial in this block, increment the block number,
\ select new Delay value, and reset trial number to 1.
\ Signal start of Nose Poke Latency counter.
#Z^Z_NewTrial: ADD M; RANDD H = G;
IF M > A(^TrialsPerBlock) [@NewBlock, @Cont]
@New: LIST U = N(S); ADD L;
IF L > A(^NumBlocks) [@End, @Cont]
@End: —> S11
@Cont: SET K = K + 9, E(K+9) = -987.987;
SET M = 1, J = J + 9, D(J+9) = -987.987;
ON ^HouseLight, ^StimLight;
SET E(K) = L, D(J) = M; Z^Z_NPLat —> S4
@Cont: SET J = J + 9, D(J+9) = -987.987;
ON ^HouseLight, ^StimLight;
SET D(J) = M; Z^Z_NPLat —> S4S11, \ Wait for Screen Update and end with
\ STOPABORTFLUSH for Automatic Data Saving
2″: —> STOPABORTFLUSH\***************************************************
\ REWARD CONTROL TIMER
\***************************************************
S.S.2,
S1,
#Z^Z_Pellet: ON ^Pellet; ADD B(1), D(J+1), E(K+1);
Z^Z_Reward —> S2S2, \ Time Reward Device for 0.05 seconds
0.05″: OFF ^Pellet; ADD R;
IF R >= Q [@Done, @Cont]
@Done: SET R = 0; Z^Z_PelletEnd —> S1
@Cont: —> S3S3,
0.45″: ON ^Pellet; ADD B(1), D(J+1), E(K+1);
Z^Z_Reward —> S2\***************************************************
\ INCREMENT TIME T FOR IRT AND EVENT ARRAY
\***************************************************
S.S.3, \ 10ms Resolution. Every 10ms = 1 Tick
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
0.01″: ADD T —> SX\*********************************************************
\ ADD A STEP ELEMENT TO ARRAY C FOR EACH CORRECT RESPONSE
\*********************************************************
S.S.4, \ Enter each Response into Array C.
\ This code is for Relative or Incremental
\ values. If Absolute or Cumulative values are
\ desired, delete the code “, T = 0” in S2.
S1,
#START: IF A(^SoftCR) > 0 [@ActivateSoftCR, @NoSoftCR]
@ActSoftCR: SET C(I) = 0.50, I = I + 1, C(I) = -987.987 —> S2
@NoSoftCR: SET C(0) = -987.987 —> SX \ Seal ArrayS2,
#Z^Z_CorrectResp: SET C(I) = T + 0.10, T = 0; ADD I;
IF I = 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\***************************************************
\ ADD A PIP ELEMENT TO ARRAY C FOR EACH REWARD
\***************************************************
S.S.5, \ Enter each Reward into Array C.
\ This code is for Relative or Incremental
\ values. If Absolute or Cumulative values are
\ desired, delete the code “, T = 0″ in S2.
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
#Z^Z_Reward: SET C(I) = T + 0.20, T = 0; ADD I;
IF I = 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\************************************************************
\ ADD AN EVENT 0 ELEMENT TO ARRAY C FOR EACH TYPE 1 OMISSION
\************************************************************
S.S.6, \ Enter each Type 1 Omission into Array C.
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
#Z^Z_Type1: SET C(I) = T + 0.60, C(I+1) = 0.50, T = 0, I = I + 2;
IF I >= 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\************************************************************
\ ADD AN EVENT 1 ELEMENT TO ARRAY C FOR EACH TYPE 2 OMISSION
\************************************************************
S.S.7, \ Enter each Type 2 Omission into Array C.
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
#Z^Z_Type2: SET C(I) = T + 0.61, C(I+1) = 0.51, T = 0, I = I + 2;
IF I >= 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\************************************************************
\ ADD AN EVENT 2 ELEMENT TO ARRAY C FOR EACH TYPE 3 OMISSION
\************************************************************
S.S.8, \ Enter each Type 3 Omission into Array C.
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
#Z^Z_Type3: SET C(I) = T + 0.62, C(I+1) = 0.52, T = 0, I = I + 2;
IF I >= 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\************************************************************
\ ADD AN EVENT 3 ELEMENT TO ARRAY C FOR EACH TYPE 4 OMISSION
\************************************************************
S.S.9, \ Enter each Type 4 Omission into Array C.
S1,
#START: IF A(^SoftCR) > 0 [] —> S2S2,
#Z^Z_Type4: SET C(I) = T + 0.63, C(I+1) = 0.53, T = 0, I = I + 2;
IF I >= 100000 [@True, @False]
@True: —> S1
@False: SET C(I) = -987.987 —> SX\***************************************************
\ NOSE POKE LATENCY COUNTER
\***************************************************
S.S.10, \ 10ms Resolution
S1,
#Z^Z_NPLat: SET O = 0.01 —> S2S2,
0.01″: SET O = O + 0.01 —> SX
#Z^Z_LatEnd: —> S1\***************************************************
\ LEVER LATENCY COUNTER
\***************************************************
S.S.11, \ 10ms Resolution
S1,
#Z^Z_LeverLat: SET P = 0.01 —> S2S2,
0.01”: SET P = P + 0.01 —> SX
#Z^Z_LatEnd: —> S1\***************************************************
\ TIME NEW TRIAL INTERVAL
\***************************************************
S.S.12, \ Times the New Trial Interval. A new trial
\ is started every A(^NTI) seconds regardless
\ of the responses that the animal has done.
S1,
#START: —> S2S2,
A(^NTITicks)#T: Z^Z_NewTrial —> S2\***************************************************
\ NOSE POKES DEFINED – 20ms BREAK, 20ms RELEASE
\***************************************************
S.S.13, \ Nose Poke Defined – 20ms Break, 20ms Release.
S1,
#Z^Z_NPLat: —> S2S2, \ Inputs in Level Mode generate an input “count” on each
\ interrupt. With a 10 ms system resolution 2 counts
\ will be reached in 20 ms. The Z^Z_NPBreak pulse is used to
\ signal a completed Beam Break. The second statement resets
\ the counter every 20 ms so that a partial Beam Break of
\ less than 20 ms will not constitute a Response.
#R^NosePoke: ADD F; IF F >= 2 [@BeamBreak, @NoBeamBreak]
@Break: SET F = 0; Z^Z_NPBreak —> S3
@NoBreak: —> SX
0.02″: SET F = 0 —> S2S3, \ As long as the Beam is broken the second statement
\ causes a re-entry to this State. This resets the
\ the internal 20 ms timer so it never times out. When
\ the Beam is released for 20 ms the timer times out
\ and a Z^Z_NPRelease pulse signals the release.
0.02″: Z^Z_NPRelease —> S1
#R^NosePoke: —> S3\***************************************************
\ UPDATE DISPLAY
\***************************************************
S.S.14,
S1,
#START: SHOW 1,Tot Pellets,B(1), 2,Immed Lvr Presses,B(2), 3,Delay Lvr Presses,B(3);
SHOW 4,Completed Trials,B(4), 5,Tot Type 1,B(5), 6,Tot Type 2,B(6);
SHOW 7,Tot Type 3,B(7), 8,Tot Type 4,B(8);
SHOW 11,Block #,L, 12,Trial #,M, 13,Delay,U/1″ —> S2S2,
1″: SHOW 1,Tot Pellets,B(1), 2,Immed Lvr Presses,B(2), 3,Delay Lvr Presses,B(3);
SHOW 4,Completed Trials,B(4), 5,Tot Type 1,B(5), 6,Tot Type 2,B(6);
SHOW 7,Tot Type 3,B(7), 8,Tot Type 4,B(8);
SHOW 11,Block #,L, 12,Trial #,M, 13,Delay,U/1″ —> S2May 7, 2019 at 9:28 am #15455Gary Bamberger
ModeratorHello Lidia,
When you respond please use the CODE option so that the formatting is preserved.
The easiest way is to make a separate state for forced immediate (S15) and forced delayed (S16). Now the subject can only respond on the desired input.
S4, \ If Nose Poke is made within allotted time, turn off \ the Stim Light and extend only one lever if a \ forced trial or both levers if a free choice trial. \ Signal start of Lever Latency counter. \ \ If Timeout, record Type 1 Omission. #Z^Z_NPBreak: OFF ^StimLight; SET D(J+5) = O; Z^Z_LeverLat; Z^Z_LatEnd; Z^Z_CorrectResp; IF M > A(^ForcedTrials) [@Free, @Forced] @Free: ON ^LeftLeverOut, ^RightLeverOut ---> S5 @Forced: IF H = 1 [@Immediate, @Delayed] @Immediate: IF A(^ImmediateLever) = ^LeftLeverIn [@Left, @Right] @Left: ON ^LeftLeverOut ---> S15 @Right: OFF ^RightLeverOut ---> S15 @Delayed: IF A(^DelayedLever) = ^LeftLeverIn [@Left, @Right] @Left: OFF ^LeftLeverOut ---> S16 @Right: ON ^RightLeverOut ---> S16 A(^ResponseTicks)#T: OFF ^HouseLight, ^StimLight; ADD B(5), E(K+5); SET D(J+3) = 1, D(J+5) = O; Z^Z_LatEnd; Z^Z_Type1 ---> S10 S15, \ Forced Immediate Reward \ If Lever response is made within allotted time, turn off \ the House Light, retracts the levers. Signal to issue \ immediate rewards. \ \ If Timeout, record Type 2 Omission. #RA(^ImmediateLever): ADD B(2), E(K+2); ON ^StimLight; OFF ^HouseLight, ^LeftLeverOut, ^RightLeverOut; SET D(J+2) = 1, D(J+6) = P, Q = 1; Z^Z_Pellet; Z^Z_NPLat; Z^Z_LatEnd; Z^Z_CorrectResp ---> S6 A(^ResponseTicks)#T: OFF ^HouseLight, ^LeftLeverOut, ^RightLeverOut; ADD B(6), E(K+6); SET D(J+3) = 2, D(J+6) = P; Z^Z_LatEnd; Z^Z_Type2 ---> S10 S16, \ Forced Delayed Reward \ If Lever response is made within allotted time, turn off \ the House Light, retracts the levers. Go to Delayed Reward \ State. \ \ If Timeout, record Type 2 Omission. #RA(^DelayedLever): ADD B(3), E(K+3); ON ^HouseLight, ^RightLeverOut; OFF ^LeftLeverOut; SET D(J+2) = 2, D(J+6) = P, Q = A(^LargeReward); Z^Z_LatEnd; Z^Z_CorrectResp ---> S7 A(^ResponseTicks)#T: OFF ^HouseLight, ^LeftLeverOut, ^RightLeverOut; ADD B(6), E(K+6); SET D(J+3) = 2, D(J+6) = P; Z^Z_LatEnd; Z^Z_Type2 ---> S10I hope that this information helps.
Gary
May 7, 2019 at 10:03 am #15456Lidia
ParticipantHi Gary.
Thanks a million !!! It works perfectly.
Honestly, thanks very much. We are really grateful for the quick response and the fitting of the code. We have been struggling for months with the code and thanks to you, now we have it.
We would like to share it. How do we do it? Do I send you a mail with the entire code?
Thanks very much once again, you have been extremely helpful.
Best,Lidia.
July 19, 2019 at 10:30 am #15593Lee Peyton
ParticipantHello Lidia,
Would you mind sharing your code with me? I have been struggling to modify this program myself to no avail.
Sincerely,
Lee -
AuthorPosts
- You must be logged in to reply to this topic.