Intermittent Reward

Yvonne Bowman's Avatar

Yvonne Bowman

18 Jun, 2018 09:07 PM

Hi Chris,

Is there an easy way to give rewards at a defined interval within a trial? For instance, if I have a monkey fixating and the trial can run for a maximum of 20s, how can I make it so the monkey gets rewarded every 2s that he fixates? I have a command to send reward through our system, but all the reward conditions in the codes I have are separate states, and I'm not sure how to integrate this type of reward using states like that.

I was thinking of using a timer within the fixation state that when it expires, the monkey gets rewarded and the timer starts over, but I'm totally unsure how to actually write something like that so that it works.

Thanks!
Yvonne

  1. Support Staff 1 Posted by Christopher Sta... on 19 Jun, 2018 08:14 PM

    Christopher Stawarz's Avatar

    Hi Yvonne,

    I was thinking of using a timer within the fixation state that when it expires, the monkey gets rewarded and the timer starts over

    That could work, although it gets complicated when fixation spans multiple states (as it often does).

    It might be simpler to use scheduled actions. I've attached an example demonstrating one way to do this. Key points to note:

    • end_reward must be false before the scheduled actions begin.
    • The "Fixation started" state does not need to transition directly to "Fixation ended". There can be any number of intermediate states.
    • Be sure that end_reward is always set to true somewhere in your task. Otherwise, the periodic reward will continue indefinitely.

    If you have any questions, please let me know.

    Chris

  2. 2 Posted by Yvonne Bowman on 21 Jun, 2018 08:55 PM

    Yvonne Bowman's Avatar

    This comment was split into a new discussion: Menu bar appears over stimulus display

    Hi Chris,

    This worked great, thanks so much!

    Best,
    Yvonne

  3. Christopher Stawarz closed this discussion on 25 Jun, 2018 02:06 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac