Welcome! Log In Create A New Profile

Advanced

Concurrent rewards of different durations

Posted by Pawel 
Concurrent rewards of different durations
September 10, 2026 06:19PM
I am trying to find a way to start rewards on two different juice lines at the same time, but the rewards may be of different durations.

After experimenting with goodmonkey and different configuration of adapters, I got to this:

%this is a single reward on juice line 1 (condtion "L")
%ClickL and ClickB are AudioSound adapters that play a short sound before reward delivery
RewardL = RewardScheduler(ClickL);
RewardL.Schedule = [0, 1e9, 1e9, reward_durL, juice_mkL];
RewardL.JuiceLine = 1;

%there are more versions of single reward: to juiceline 2 and 3 (conditions "R" and "W"), 
%I am not showing them here, they are coded identically to condition "L"

%these are adapters to be used when both juicelines 1 & 2 are supposed to be activated at the same time (condition "B")
RewardBL = RewardScheduler(Clickcool smiley;
RewardBL.Schedule = [0, 1e9, 1e9, reward_durL, juice_mkL];
RewardBL.JuiceLine = 1;

RewardBR = RewardScheduler(Clickcool smiley;
RewardBR.Schedule = [0, 1e9, 1e9, reward_durR, juice_mkR];
RewardBR.JuiceLine = 2;


RewardTimerL = TimeCounter(ClickL);
RewardTimerL.Duration = reward_durL + 100;
GiveRewardL = Concurrent(RewardTimerL);
GiveRewardL.add(RewardL);


RewardTimerB = TimeCounter(Clickcool smiley;
RewardTimerB.Duration = max([reward_durL, reward_durR]) + 100;
GiveRewardB = Concurrent(RewardTimercool smiley;
GiveRewardB.add(RewardBL);
GiveRewardB.add(RewardBR);



The code above works fine for condition "L" (as well as conditions "R" and "W"), but for condition "B" it seems to gives only a very short pulse to line 1 (RewardBL) and a pulse of requested duration to line 2. It seems that sending a pulse to line 2 by RewardBR cuts off the pulse given to line 1 by RewardBL.

Is there another way to achieve what I need?
Re: Concurrent rewards of different durations
September 10, 2026 06:49PM
For now, there is no way to deliver two rewards of different durations at the same time.
Re: Concurrent rewards of different durations
September 10, 2026 08:47PM
Got it, thank your for responding quickly!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.