Delayed reward species: any
Maintainer Filip van den Bergh Current version 0.1 View the changelog
Original Author Filip van den Bergh Date last modified Jan-29-2004
License BSD MED-PC version 4
In the delayed reward task, animals make a choice between a small, immediately available reward, and a large reward that is available after a delay. This version consists of several blocks with a number of trials inside. The first two trials wityhin each block are always forced trials. There is a maximum of 10 trials per block. There is no maximum number of blocks. The code can easily be adapted to work with nose-poke holes instead.
Cardinal RN, Robbins TW, Everitt BJ. Psychopharmacology (Berl). 2000 Nov;152(4):362-75.
The effects of d-amphetamine, chlordiazepoxide, alpha-flupenthixol and behavioural manipulations on choice of signalled and unsignalled delayed reinforcement in rats.
Code
How to use this code Download the code Download an example macro Download the profile
 
            
\Z-pulses
\1 Start session
\2 End session
\3 Start new block
\4 Start trial
\5 Small choice
\6 Large choice
\7 Omission

\Adjusted code [RAT]
^Left=4
^LeftLever=4
^Right=2
^RightLever=2
^Magazine=8
^Houselight=7
^Feeder=8
^Tone=9
^LeftExt=4
^ExtLeft=4
^RightExt=2
^ExtRight=2
^LeftLight=4
^RightLight=2
^MiddleLight=3
^Centrelight=3
^MagazineLight=17
\End common code


\Inputs
^LeftLever=4
^RightLever=2
^Magazine=3

\Training parameters
LIST M=10,100,8, 6, 10, 90
\LIST D=60, 60, 30, 20, 10, 5, 0, 0
LIST D=0, 0, 5, 10, 20, 30, 60
           \Delay for every of the 5 blocks, D(0) en D(6) doen niet mee
var_alias  Reward size = Q
var_alias  Maximum choice time = M(0)
var_alias  Trial length = M(1)
var_alias  Inter-block trials (<10!) = M(2)
var_alias  Number of blocks = M(3)
var_alias  Maximum time to invoke trials = M(4)
var_alias  Maximum session time hopefully only reached during the very first training trials = M(5)

\System variables
var_alias  Block = B
var_alias  Trial = T
var_alias  Small reward lever = Z
var_alias  Large reward lever = X
LIST E=0,1
var_alias  Choices = E 
DIM F=1    \Chosen lever, once for the first forced trial, once for the second
DIM G=1    \Forced lever options
DIM H=1    \Forced lever options extend lever

\Dependents
DIM R=80   \Response -1=small, 1=large, 9=omission 0=trial not initiated
var_alias  Choice for small reward = I
var_alias  Choice for large reward = O
DIM L=80   \Response latency, Large
DIM N=80   \Response latency, Small
DIM C=80   \Collection latency

DIM S=4
var_alias  Total time = S(0)
var_alias  Rewards counter = S(1) \counts up to Q
var_alias  Latency counter = S(2)
var_alias  Latency counter for collection = S(3)
var_alias  Latency memory for substraction from M(1) = S(4)


\=== Session start, end and time counter =============================
S.S.1,
S1,
	0.1":	SET G(0)=^LeftLever;
		SET G(1)=^RightLever;
		SET H(0)=^LeftExt;
		SET H(1)=^RightExt ---> S2
S2,
	0.1": 	SET Z=^LeftLever; \small
		SET X=^RightLever; \large
		SET Q=4 ---> S5 \rewards
S5,
	#START:	SET M(0)=M(0)*1";
		SET M(1)=M(1)*1";
		SET M(4)=M(4)*1";
		SET D(0)=D(0)*1";
		SET D(1)=D(1)*1";
		SET D(2)=D(2)*1";
		SET D(3)=D(3)*1";
		SET D(4)=D(4)*1";
		SET D(5)=D(5)*1";
		SET D(6)=D(6)*1";
		ON ^Houselight; Z1 ---> S10
S10,
	#Z2:	SHOW 1, Closed, S(0)/60;
		OFF ^RightExt,^LeftExt,^HouseLight ---> StopAbortFlush
	0.1":	SET S(0)=S(0)+.1; IF S(0)/60>M(5) [@TrueStop, @FalseContinue]
			@TrueStop: 	SHOW 1, Closed, S(0)/60;
					OFF ^RightExt,^LeftExt,^HouseLight ---> StopAbortFlush
			@FalseContinue: ---> S10


\=== Trial ===========================================================
S.S.5,
S1,
	#Z1:	---> S4
S4,
	(M(1)-S(4))#T: ON^CentreLight ---> S5
S5, \Trial core: forced trials
	#R^Centrelight:	OFF^CentreLight;ADD B; IF B>M(3) [@TrueEnd, @FalseContiue]
		@TrueEnd: 	Z2; SHOW 1, Closed, S(0)/60;
				OFF ^RightExt,^LeftExt,^HouseLight ---> StopAbortFlush
		@FalseContinue:	SET T=1; 
				RANDI F(0)=E;  \WAS RANDD
				SET F(1)=(F(0)-1)*-1;
				ON H(F(0));
				Z4 ---> S6  
S6, \First forced trial
	#RG(F(0)): IF G(F(0))=Z [@TrueSmall, @FalseLarge]
		@TrueSmall:	Z5; SET R(B*10+T)=-1; OFF H(F(0)); ADD T ---> S8
		@FalseLarge:	Z6; SET R(B*10+T)=1; OFF H(F(0)); ADD T ---> S8
	\M(0)#T: Z7; SET R(B*10+T)=9; OFF H(F(0)); ADD T ---> S8
S7, \Wait for collection
	#R^Magazine: ---> S8
S8,
	(M(1)-S(4))#T: ON^CentreLight ---> S9
S9, \Second forced trial
	#R^CentreLight:	OFF^CentreLight; ON H(F(1)); Z4 ---> S10
S10, 
	#RG(F(1)): IF G(F(1))=Z [@TrueSmall, @FalseLarge]
		@TrueSmall:	Z5; SET R(B*10+T)=-1; OFF H(F(1)); ADD T ---> S14
		@FalseLarge:	Z6; SET R(B*10+T)=1; OFF H(F(1)); ADD T ---> S14
	\M(0)#T: Z7; SET R(B*10+T)=9; OFF H(F(1)); ADD T ---> S14
S11, \Wait for collection
	#R^Magazine: ---> S14
S14,
	(M(1)-S(4))#T: ON^CentreLight ---> S15
S15, \Choice trials
	#R^CentreLight: OFF^CentreLight;ON ^LeftExt,^RightExt; Z4 ---> S16
S16,
	#RZ:	Z5; SET R(B*10+T)=-1; OFF ^LeftExt, ^RightExt; ADD T; ADD I; IF T>M(2) [@TrueNewblock, @FalseContinue]
			@TrueNewblock: ---> S4
			@FalseContinue: ---> S14 
	#RX:	Z6; SET R(B*10+T)=1; OFF ^LeftExt, ^RightExt; ADD T; ADD O; IF T>M(2) [@TrueNewblock, @FalseContinue]
			@TrueNewblock: ---> S4
			@FalseContinue: ---> S14
	M(0)#T:	Z7; SET R(B*10+T)=9; OFF ^LeftExt, ^RightExt; ADD T; IF T>M(2) [@TrueNewblock, @FalseContinue]
			@TrueNewblock: ---> S4
			@FalseContinue: ---> S14

\=== Rewards==========================================================
S.S.6,
S1,
	#Z5:	ON ^Feeder ---> S10
	#Z6:	---> S2
S2,
	D(B)#T:	SET S(1)=0; ON ^Feeder; ADD S(1) ---> S3
S3,
	0.1":	OFF ^Feeder ---> S4
S4,
	0.1":	ON ^Feeder; ADD S(1); IF S(1) S3
		@FalseEnough: ---> S10
S10,
	1":	OFF ^Feeder ---> S1


\=== Latencies =======================================================
S.S.7,
S1,
	#Z4:	SET S(2)=0 ---> S2
S2,
	0.1":	SET S(2)=S(2)+0.1 ---> S2
	#Z5:	SET N(B*10+T)=S(2); SET S(4)=S(2) ---> S3
	#Z6:	SET L(B*10+T)=S(2); SET S(4)=S(2) ---> S3
S3,
	0.1":	SET S(3)=S(3)+0.1; IF S(3)>M(0) [@TrueStop,@FalseCOntinue]
			@TrueStop: SET C(B*10+T)=-1 ---> S1
			@FalseContinue: ---> S3
	#R^Magazine: SET C(B*10+T)=S(3); SET S(3)=0 ---> S1

\=== Screen code =====================================================
S.S.10,
S1,
	.1": 	SHOW 1,Minutes,S(0)/60;
		SHOW 4,Delay,D(B);
		SHOW 3,PrefSm,I/(I+O+.00000001)*100; 
		SHOW 5,Trial,B*10+T;
		SHOW 6, Delay 2, D(2);
		SHOW 7, Delay 3, D(3);
		SHOW 8, Delay 4, D(4);
		SHOW 9, Delay 5, D(5);
		SHOW 10, Delay 6, D(6);
		SHOW 11, Chc lat, S(4);
		SHOW 16, Chc 1-2, R(14);
		SHOW 17, Chc 1-3, R(15);
		SHOW 18, Chc 1-4, R(16);
		SHOW 19, Chc 1-5, R(17);
		SHOW 20, Chc 1-6, R(18);
		SHOW 21, Chc 2-2, R(24);
		SHOW 22, Chc 2-3, R(25);
		SHOW 23, Chc 2-4, R(26);
		SHOW 24, Chc 2-5, R(27);
		SHOW 25, Chc 2-6, R(28);
		SHOW 26, Chc 3-2, R(34);
		SHOW 27, Chc 3-3, R(35);
		SHOW 28, Chc 3-4, R(36);
		SHOW 29, Chc 3-5, R(37);
		SHOW 30, Chc 3-6, R(38);
		SHOW 31, Chc 4-2, R(44);
		SHOW 32, Chc 4-3, R(45);
		SHOW 33, Chc 4-4, R(46);
		SHOW 34, Chc 4-5, R(47);
		SHOW 35, Chc 4-6, R(48);
		SHOW 36, Chc 5-2, R(54);
		SHOW 37, Chc 5-3, R(55);
		SHOW 38, Chc 5-4, R(56);
		SHOW 39, Chc 5-5, R(57);
		SHOW 40, Chc 5-6, R(58);
		SHOW 41, Chc 6-2, R(64);
		SHOW 42, Chc 6-3, R(65);
		SHOW 43, Chc 6-4, R(66);
		SHOW 44, Chc 6-5, R(67);
		SHOW 45, Chc 6-6, R(68)---> S1
	#Z4:	SHOW 2,Start,B*10+T ---> S1
	#Z5:	SHOW 2,Ch_Sm,0 ---> S1
	#Z6:	SHOW 2,Ch_La,0 ---> S1
	#Z7:	SHOW 2,Omission,0 ---> S1
            
Related programs Other versions
An SPSS script for post-processing

No older versions available
No experimental versions available