Randomizing magnitude of reward output
MEDState Notation Repository › Forums › Coding Help Archive › Randomizing magnitude of reward output
- This topic has 4 replies, 1 voice, and was last updated 8 years, 9 months ago by
Med_Support.
-
AuthorPosts
-
February 13, 2017 at 6:14 am #12680
Med_Support
ModeratorGary Bamberger
So I had a bug in my list statement. It should have been:
LIST Z = 5,5,2,5,2,5,1,2,5,5So the number 5 is listed 6 times, 2 is listed 3 times, and 1 is listed 1 time.
When the lever is pressed we are drawing from the list randomly with the RANDD command.
S5, #RLever: RANDD R = Z; Z^Reward ---> S6I don’t know what number will be drawn, but after it has been drawn the number is removed from the list and can’t be drawn again until every number has been drawn at least once at which point the list is refreshed for the next 10 trials. That is what the RANDD command does.
So for every 10 trials the frequency of 6,3,1 is guaranteed, but the order will be random.
Gary
February 14, 2017 at 1:16 am #12674Med_Support
Moderatorneur0mancer
Hi everyone, my lab group is trying to figure out if there is a way to program the pellet dispenser with 3 separate reward amounts and with specified percentages for reward outcomes?
As an example, upon lever press, there is a 60% chance of dispensing 5 pellets, a 30% chance of dispensing 2 pellets, and a 10% chance of dispensing 1. So then across 10 trials it would release 5 pellets 6/10 times, 3 pellets 3/10, and 1 pellet 1/10, etc.
Thanks in advance!
February 14, 2017 at 11:28 am #12675Med_Support
ModeratorHello,
The way that I would do it is to create a list with the number of pellets.
LIST Z = 5,5,3,5,3,5,1,3,5,5
When the lever is pressed draw a value from the list randomly and then issue a Z-pulse to start the pellet dispenser.
S5,
#RLever: RANDD R = Z; Z^Reward —> S6The following code can be used to dispense multiple pellets
\ Outputs ^Pellet = 3 \ Z-Pulses Used in this Program ^Z_Reward = 1 \ Z1 = Signal Reinforcement \*************************************************** \ PELLET DISPENSER CONTROL \*************************************************** S.S.2, S1, \ Wait for Reinforcement Signal #Z^Z_Reward: ON ^Pellet; ADD P ---> S2 S2, \ Check if delivered desired Number of Pellets 0.05": OFF ^Pellet; IF P >= R [@Done, @More] @Done: SET P = 0 ---> S1 @More: ---> S3 S3, \ Must wait a certain amount of time before \ trying to dispense the next pellet. This \ delay can be shortened for some Pellet \ Dispensers. 0.5": ON ^Pellet; ADD P ---> S2I hope that this helps.
GaryFebruary 14, 2017 at 5:20 pm #12678Med_Support
Moderatorneur0mancer
Hi, this does help to an extent, but I should have clarified: the reward outcome frequency should not be random (as in 5 pellets should be dispensed exactly 6/10 times in 10 trials, 2 pellets exactly 3/10 times, and 1 pellet exactly 1/10 times, etc)…however, the order that the reward outcomes appear in should be randomized. Is this still possible?
Thank you for your help thus far.
February 15, 2017 at 11:14 am #12683Med_Support
Moderatorneur0mancer
Wonderful, this is exactly what we needed.
Thank you so much for your help here.
-
AuthorPosts
- You must be logged in to reply to this topic.