\Experiment 4 simple SDT with flashing stimuli
\keeps the time of every event
\Michael Davison
\Outputs
^LeftWhite=1 \1 = Left (WHITE)
^LeftCenterS1=2 \2 = Left Centre S1 (RED)
^LeftCenterS2=3 \3 = Left Centre S2 (GREEN)
^RightWhite=4 \4 = Right Centre (WHITE)
^Magazine=5 \5 = mag
^MagazineLight=6 \6 = mag light
\Inputs
^LeftKeyPeck=1 \1 = Left key peck
^LeftCentreKeyPeck=2 \2 = Left Centre key peck
^RightCentreKeyPeck=3 \3 = Right Centre key peck
\4 = Right key, unused
\z pulses
^ReinforcerStart=1
^StartFlasher=2
^StopFlasher=3
\q array is the settings for conditions
\q(0),q(1) not used in this experiment
\q(2) = probability of reinforcement for left correct responses (complememt is p. for right correct)
\q(3) = Reinforcers per session
\q(4) = Magazine duration in seconds
\q(5) = blackout time in seconds
\q(6) = Inter-trial interval time in seconds
\q(7) & q(8) = durations of Red and Green flash times on left-centre key
\Condition 1
\list q = 0,10000/30,5000,60,3,10,5,1.2,0.44\ Condition 1 1:1 reinforcer ratio on 08/02/01
\100 sessions per condition, please keep all data on directory in d:\expt4\condx
dim c = 5
\overall counts:
\c(0) = LeftCorrect|S1 W
\c(1) = RightError|S1 X
\c(2) = LeftError|S2 Y
\c(3) = RightCorrect|S2 Z
\c(4) = Left Rfts
\c(5) = Right Rfts
\detailed data collection into the x array with index t:
dim x=5000
\Codes for detailed data collection:
^SessStart=10000
^Stim1on=20000
^Stim2on=30000
^Bw=40000
^Bx=50000
^By=60000
^Bz=70000
^Rw=80000
^Rz=90000
^NRW=100000
^NRZ=110000
^ITIStart=120000
^CKPeck=130000
diskvars = c,q,x
s.s.1,
s1,
#start:set q(4)=q(4)*1",q(5)=q(5)*1",q(6)=q(6)*1",q(7)=q(7)*1",q(8)=q(8)*1"; \ set times to ticks
set t=0; \ in itialize index
set x(t)=btime/1"+^sessstart;--->s8
s2,\ Set up stimulus
1 #T:withpi=5000[@S1,@s2]
@s1:set s=2; \ set trial type s
set f=q(7); \ set durations of Red and Green
set g=q(8);
z^StartFlasher; \ start flasher
add t;
set x(t)=btime/1"+^Stim1on;--->s3
@s2:set s=3;
set f=q(8);
set g=q(7);
z^StartFlasher; \ start flasher
add t;
set x(t)=btime/1"+^Stim2on;--->s3
s3,\ Stimulus presentation
#R^LeftCentreKeyPeck:z^StopFlasher; \ stop flasher
add t;
set x(t)=btime/1"+^CKPeck; \ store time of peck
off ^LeftCenterS1,^LeftCenterS2; \ turn off flasher lights -- overkill!
on ^LeftWhite,^RightWhite;--->s4 \ turn on choice keys
s4, \ main routine
#R^LeftKeyPeck:off ^LeftWhite,^RightWhite;if s=2[@CorrectLeft,@ErrorLeft]
@correctLeft:add c(0);
add t;
set x(t)=btime/1"+^Bw; \ store time of choice
if s.s.2=3[@ReinforcerSetup,@Rnotsetup]
@ReinforcerSetup:z^ReinforcerStart;
add c(4);
on ^Magazine,^MagazineLight;
add t;
set x(t)=btime/1"+^Rw;--->s5
@RNotSetup:add t;
set x(t)=btime/1"+^NRW;--->s5
@errorLeft:add c(2);
add t;
set x(t)=btime/1"+^By;--->s6
#R^RightCentreKeyPeck:off ^LeftWhite,^RightWhite;if s=3[@CorrectRight,@ErrorRight]
@CorrectRight:add c(3);
add t;
set x(t)=btime/1"+^Bz;
if s.s.2=4[@ReinforcerSetup,@RNotSetup]
@ReinforcerSetup:z^ReinforcerStart;
add c(5);
on ^Magazine,^MagazineLight;
add t;
set x(t)=btime/1"+^Rz;--->s5
@RNotSetup:add t;
set x(t)=btime/1"+^NRZ;--->s5
@ErrorRight:add c(1);
add t;
set x(t)=btime/1"+^Bx;--->s6
s5,\ Reinforcer time
q(4) #T:off ^Magazine,^MagazineLight;
show 1,W,c(0),2,X,C(1),3,Y,C(2),4,Z,C(3);
add t;
set x(t)=btime/1"+^ITIStart;--->s7
s6,\ BO Time
q(5) #T:show 1,W,c(0),2,X,C(1),3,Y,C(2),4,Z,C(3);
add t;
set x(t)=btime/1"+^ITIStart;--->s7
s7,\ Inter-trial interval
q(6) #T:--->s2
s8,\ Waiting to be sure box has woken up - doug added this
1":--->s2
s.s.2, \scheduling dependent, overall (runs always)
s1,
#start:--->s2
s2,
1":withpi=q(2)[@SetupLeftReinforcer,@SetupRightReinforcer]
@SetupLeftReinforcer:--->s3
@SetupRightReinforcer:--->s4
s3,\ Left rft set up
#z^ReinforcerStart:--->s2
s4,\ Right rft set up
#z^ReinforcerStart:--->s2
s.s.3, \data collection
s1,
#start:--->s2
s2,
q(3)#z^ReinforcerStart!2500":--->s3 \stop session after q(3) reinforcers or after 2500 seconds
s3,
q(4) #T:off 1,2,3,4,5;--->stopabortflush
s.s.4,\ Flasher
s1,
#start:--->s2
s2,
#z^StartFlasher:on ^LeftCenterS1;--->s3
s3,
f#T:off ^LeftCenterS1;on ^LeftCenterS2;--->s4
#z^StopFlasher:off ^LeftCenterS2;--->s2
s4,
g#T:off ^LeftCenterS2;on^LeftCenterS1;--->s3
#z^StopFlasher:off ^LeftCenterS1;--->s2
|