Autoshaping for Aves
MEDState Notation Repository › Forums › Coding Help Archive › Autoshaping for Aves
- This topic has 1 reply, 1 voice, and was last updated 8 years, 9 months ago by
Med_Support.
-
AuthorPosts
-
July 6, 2016 at 12:01 pm #12721
Med_Support
Moderatorbari226
I am brand new to MedPC and trying to modify the below rodent model code to a quail code. I need a 90 sec. VI where there is a CS+ (right green light 5 sec) followed by a 8 sec. food access (access not pellet delivery as there quail so it is a access food hopper). With a CS- light (left red light 5 sec) that is random during the 90 sec.
I need 20 sessions of the CS+ and non-contingent food hopper access. With 20 CS- in the VI time.
I would like to count the latency to food hopper when access is on.
Entries into food hopper during VI and when ON separately.
I need to count both Key peck to CS+ and CS- light.
Can you look at the code I am working on and help me? I would so appreciate it!!!... \Program Name: Automaintenance40 \***************************************************************** \** This program delivers food at the end of a a 90" VI, and a 5" CS ** \** Ends after 20 cycles ** \** ** \** Written by J. Beckmann - August 28, 2008. Modified by B.A. Rice, 2016 ** \INPUTS USED: ^Lfoodhopper=7 \hopper ^LeftKey=1 ^RightKey=2 \OUTPUTS: ^LRed=1 ^LGreen=3 ^RRed=4 ^RGreen=6 ^Hopper=7 ................................................................................... \Program Name: Automaintenance40 \***************************************************************** \** This program delivers food at the end of a 45" cycle with a ** \** probability of .5, a 40" ITI, and a 5" CS ** \** Ends after 100 cycles ** \** ** \** Written by J. Beckmann - August 28, 2008. ** \INPUTS USED: ^LLever=1 \Left Lever ^RLever=3 \Right Lever \OUTPUTS: ^LeftLight = 4 ^RightLight = 5 ^Feeder = 3 ^HouseLight = 7 \^Pump = 8 ^LLevRetract = 1 ^RLevRetract = 2 \VARIABLES: \d - VT interval, chosen from lists \e - timer for inter-events \f - timer for VTs \j - counter for indexing inter-event recording \k - total time VT/total work time \t - array used for recording inter-event times \x - pellets dispensed - .30 \y - session time counter \a - # of lever presses \l - increment irt array \c - array for irt \m - irt timer \n - trial counter \p - array for responses per trial \w - within trial responses \g - increment response per trial array \b - trial flag - 1 during trial and 0 otherwise \z - reinforcement occurrence \u - array for reinforcement \v - increment reinforcement array \Z PULSES: \z2- VT timer start \z3- VT timer stop \z4- starts IRT timer \z5 - start CS presentation \z6- reinforcement \z7- within trial recorder \.5 start of session \.77 end of session \ARRAYS: dim t = 60000 dim c = 60000 dim p = 105 dim u = 105 \MAIN PROGRAM: \ s.s.1, \SET UP s1, #start: set y=0,x=0, j=0,k=0, f=0,d=0;set t(j) = e + 0.50; add j;set e=0; on ^HouseLight; z2; z5--->s1 s.s.2, \ITI TIMER s1, #z2:--->s2 #z3:--->s1 s2, .01":add f; add k--->s2 #z3:--->s1 s.s.3, \RECORD LEVER PRESSES s1, #R^LLever: add a; set c(l) = m; add l;set m=0;set t(j) = e + 0.20;add j;set e=0--->s1 s.s.4, \IRT TIMER s1, #z4: --->s2 s2, .01": add m--->s2 s.s.5, \GOTO FOOD PRESENTATION s1, #z5:--->s2 s2, .01": if f>=4000 [@t,@f] @t: z4;set b=1; on ^LLevRetract;z7---> s3 @f: ---> s2 s3, 5": set b=0; off ^LLevRetract; set m=0; set p(g)=w; add g ; if n=0 [@t,@f] @t: add n; z6--->s1 @f: add n; withpi=5000[@rf,@norf] @rf:z6--->s1 @norf:--->s4 s4, 2.5": set f=0; set w=0; z2;set z=0;set u(v) = z;add v; z5--->s1 s.s.6, \FOOD PRESENTATION s1, #z6:z3;off ^LLevRetract; on ^feeder;add x;set t(j) = e + 0.30;add j;set e=0;set z=1;set u(v) = z;add v--->s2 s2, 2.5":off ^feeder;set f=0;set w=0 ;z2; z5--->s1 s.s.7, \Within Trial Response Counter s1, #z7:--->s2 s2, #R^LLever: if b=1 [@t,@f] @t: add w; --->s2 @f: --->s1 s.s.8, \INTER EVENT TIMER s1, #start: --->s2 s2, .01": add e;show 1,Trial, n; show 2,Responses, a; show 3,W/IN, w--->s2 s.s.9, \SESSION END s1, #start:--->s2 s2, .01": if n>=100 [@t,@f] @t:set t(j) = e + 0.77; add j;set e = 0;set t(j) =-987.987;add j; set c(l) =-987.987;set p(g) =-987.987;set u(v) = -987.987--->stopabortflush @f:--->s2
July 6, 2016 at 1:40 pm #12722Med_Support
ModeratorJim Frei
Hi BethAnn,
Please see the email i sent you.
Thank you,
Jim
-
AuthorPosts
- You must be logged in to reply to this topic.