Extinction Code Help
MEDState Notation Repository › Forums › Coding Help Archive › Extinction Code Help
- This topic has 4 replies, 1 voice, and was last updated 8 years, 12 months ago by
Med_Support.
-
AuthorPosts
-
September 22, 2014 at 8:04 pm #12910
Med_Support
Moderatormcwaters
Hi,
We’re currently working on a 2 hour extinction protocol. We think everything is figured out except for: After 1 hour, if the left lever hasn’t been pressed, we would like the session to end. So, we want to stopabortflush after 120 mins or after 60 minutes with a left lever press, whichever comes first. Is this possible? How could we code it? Thank you for your help!
Coding so far:
\ Inputs ^LeftLever = 1 ^RightLever = 3 \ Outputs ^Pellet = 3 ^LeftLight = 4 ^LeftLeverOperate= 1 ^HouseLight = 7 ^Fan = 9 ^RightLight = 5 ^RightLeverOperate = 2 \DEFINED VARIABLES \A = NUMBER OF RESPONSES \B = NUMBER OF REWARDS \E = DATA ARRAY LEFTLEVER \F = DATA ARRAY RIGHTlEVER \G = DATA ARRAY REWARD \M = MINUTES \X = FIXED RATIO \N = SESSION TIMER \Q = MAXIMUM REWARD VAR_ALIAS Fixed ratio = X VAR_ALIAS Maximum reward = Q VAR_ALIAS duration session (min) = M DIM E = 30 DIM F = 30 DIM G = 30 DIM J = 150 S.S.1, \Main control logic for "FR" S1, 0.001": SET X = 1600; SET Q = 1500; SET M = 120 ---> S2 S2, 0.001": ON ^Fan ---> S3 S3, #START: ON ^HouseLight, ^LeftLeverOperate, ^RightLeverOperate; ---> S4 S4, 1500#R^LeftLever: OFF ^HouseLight, ^LeftLeverOperate, ^RightLeverOperate; ON ^Pellet; Z1 ---> S5 #Z2:--->S1 S5, 20": ---> S4 #Z2: ---> S1 S.S.2, \This is the state set that contains the response count and display of the active lever S1, #Start: SHOW 2,ACTIVE,A---> S2 S2, 1#R^LeftLever: ADD A; SET E(A) = n ;SHOW 2,ACTIVE,A ---> SX #Z2:--->S1 S.S.3, \ This is the state set that contains the response count and display of the inactive lever S1, #START: SHOW 3,INACTIVE,B ---> S2 S2, 1#R^RightLever: ADD B; SET F(B) = N; SHOW 3,INACTIVE,B ---> SX #Z2: ---> S1 S.S.4, \Session Timer S1, #START: SHOW 1,Sess_n,N ---> S2 S2, 1.0": ADD N; SHOW 1, Sess_n,N; IF (N/60 >= M) OR (B >= Q) [@True, @False] \As long as session time < M we will continue @True: Z2 ---> S3 @False: ---> SX S3, 1.0": OFF ^HouseLight, ^LeftLeverOperate, ^RightLeverOperate, ---> STOPABORTFLUSH
September 23, 2014 at 8:46 am #12909Med_Support
ModeratorGary Bamberger
I think that the following change will do what you want:
S.S.2, \ This is the state set that contains the response count and display of the active lever S1, #START: SHOW 2,ACTIVE,A ---> S2 S2, 1#R^LeftLever: ADD A; SET E(A) = N; SHOW 2,ACTIVE,A ---> SX 60': Z2 ---> S3 #Z2: ---> S1 S3, 1": OFF ^HouseLight, ^LeftLeverOperate, ^RightLeverOperate ---> STOPABORTFLUSH
Gary
September 23, 2014 at 11:45 am #12913Med_Support
Moderatormcwaters
Hi Gary,
Thank you for your help. When replacing our S.S.2 section for yours, all boxes stopabortflush after 60 minutes, regardless of response. Is there a way to make it so that the only boxes that stopabortflush are those without a left lever response for 60 minutes? In other words, we want rats with left lever responses to continue for the full 2 hours.
Thanks again!
September 23, 2014 at 11:52 am #12916Med_Support
ModeratorGary Bamberger
Yes, change the SX in State 2 to S2
S2, 1#R^LeftLever: ADD A; SET E(A) = N; SHOW 2,ACTIVE,A ---> S2
That should reset the 60 minute counter. Sorry for the mistake.
GarySeptember 23, 2014 at 12:22 pm #12918Med_Support
Moderatormcwaters
Sorry, we should have caught that. Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.