Randomizing magnitude of reward output

MEDState Notation Repository Forums Coding Help Archive Randomizing magnitude of reward output

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #12680
    Med_Support
    Moderator
    Gary 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,5
    

    So 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 ---> S6
    

    I 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

    #12674
    Med_Support
    Moderator
    neur0mancer

    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!

    #12675
    Med_Support
    Moderator

    Hello,

    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 —> S6

    The 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 ---> S2
    

    I hope that this helps.
    Gary

    #12678
    Med_Support
    Moderator
    neur0mancer

    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.

    #12683
    Med_Support
    Moderator
    neur0mancer

    Wonderful, this is exactly what we needed.

    Thank you so much for your help here.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.