Simple operant procedures species: any
Maintainer Filip van den Bergh Current version 0.1 View the changelog
Original Author Filip van den Bergh Date last modified Mar-7-2005
License BSD MED-PC version 4
This is an example procedure for conducting simple operant tasks, such as fixed ratio, reversal or extinction learning. The procedure is designed to be flexible and allow for many different tasks, but it's easy to improve the design.
From the macro, set the value of K to the input number of the reinforced lever.
No references given. Click to e-mail a reference to the maintainer.
Code
How to use this code Download the code Download an example macro Download the profile
 \ACQUISITION OPERANT BEHAVIOR
\First version, February 18, 2002
\Filip van den Bergh

\Z-Pulses
\1  Start session
\2  End session
\3  Lever press
\4  Reward

^Houselight=7
^Left=7
^Right=6
^ExtLeft=15
^ExtRight=14
^Feeder=8

\Training parameters
DIM A=5
VAR_ALIAS Fixed ratio = A(0)
VAR_ALIAS Maximum total duration = A(1)
VAR_ALIAS Maximum number of trials = A(2)
VAR_ALIAS Maximum number of reinforcers = A(3)

\Dependents
DIM X=10
VAR_ALIAS Reinforcers = X(0)
VAR_ALIAS Left lever responses = X(1)
VAR_ALIAS Right lever responses = X(2)

DIM T=300
VAR_ALIAS Reinforcers per 1-minute block = T(0)
DIM R=300
VAR_ALIAS Responses on right lever per 1-minute block = R(0)
DIM L=300
VAR_ALIAS Responses on left lever per 1-minute block = L(0)

\System variables
DIM S=5
VAR_ALIAS Time in seconds = S(0)
VAR_ALIAS Minute counter = S(2)
VAR_ALIAS Fixed ratio countdown = S(3)

VAR_ALIAS Reinforced lever = K

\========================================================

S.S.1,
\Time definitions, session start, session end
S1,
	0.1": 	SET A(0)=1;	\FR1
		SET A(1)=30;	\Maximum duration: 60'
		SET A(3)=50;	\Maximum number of rewards: 50
		SET K=^Right ---> S2	
S2,
	#START: ON ^Houselight;
		ON ^ExtLeft, ^ExtRight;
		Z1 ---> S4
S4,
	#Z2:	SHOW 1, Session closed, S(0)/60;
		SHOW 3, Reinforcers, X(0);
		SHOW 4, Left resp, X(2);
		SHOW 5, Right resp, X(1);
		OFF ^ExtLeft, ^ExtRight, ^Houselight ---> STOPABORTFLUSH

\========================================================

S.S.2,
\Timer and session end
S1,
	#Z1	---> S2
S2,
	.01":	SET S(0)=S(0)+.01;
		IF (S(0))>= (A(1)*60) [@TrueEnd, @FalseContinue]
			@TrueEnd: Z2; SHOW 2, Max time, A(1) ---> SX
			@FalseContinue: ---> S2

\========================================================

S.S.3,
\Timer part two: add to minute counter 
S1,
	#Z1:	---> S2
S2,
	1': 	ADD S(2) ---> S2

\========================================================

S.S.4,
\Response counter 
S1,
	#R^Right: ADD R(S(2)); ADD X(1) ---> S1
	#R^Left:  ADD L(S(2)); ADD X(2) ---> S1

\========================================================

S.S.5,
\Trial
S1,
	#Z1: 	SET S(3)=A(0); SHOW 2, First resp, S(3) ---> S2
S2,
	#RK:	SET S(3)=S(3)-1; SHOW 2, Resps needed, S(3); IF S(3)=0 [@TrueReward, @FalseContinue]
			@TrueReward: 	Z4; 
					SET S(3)=A(0); 
					ADD T(S(2)); ADD X(0); 
					SHOW 2, Collect, 0; 
					IF X(0)>=A(3) [@True, @False] 
						@True: Z2; SHOW 2, Max reinf, A(3) ---> SX
						@False: SHOW 2, Resps needed, S(3)---> S2
			@FalseContinue: ---> S2

\========================================================

S.S.6,
\Rewards
S1,
	#Z4:	ON^Feeder ---> S2
S2,
	.5":	OFF^Feeder ---> S1

\========================================================

S.S.10,
\Screen write code
S1,
	#Z1 	---> S2
S2,
	.1":	SHOW 1, Minutes, S(0)/60;
		SHOW 3, Reinforcers, X(0);
		SHOW 4, Left resp, X(2);
		SHOW 5, Right resp, X(1);

		SHOW 6, Fixed ratio, A(0);
		SHOW 7, Max time, A(1);
		SHOW 8, Max trials, A(2);
		SHOW 9, Reinf lever, K;
		SHOW 14, Right lever, ^Right;
		SHOW 15, Left lever, ^Left ---> S2
              
Related programs Other versions
No training programs submitted/required

No older versions available
No experimental versions available