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
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
Attachment: periodic_reward.mwel.zip (779 Bytes)
Hi Chris,
This worked great, thanks so much!
Best,
Yvonne