• BpodSoftware
  • count portIn event number and scale outcome action/reward with that number

Hi Josh,

I am trying to figure out a way to count how many of portIn event given a set time window, and based on that number, determine different outcome actions. For instance, something like lick more and get more reward, lick less and less reward.
I found something called SetGlobalCounter, however, it seems it cannot give you the number of event counts within a window, it can only tell you if if reached at certain threshold. Wondering if there is any other way to do this?

Thank you so much!

Best,
Miaomiao

Hello MiaoMiao,

Unfortunately there isn't a continuous way to map a number of pokes in a window to reward size. You can discretize the problem with an awkwardly large state machine description. Each lick moves the animal to a new state. In each state, a GlobalTimer_End event moves the animal to a matching reward state. The global timer has to start in the first state of the series.

-Josh

Josh wrote[quote='Josh' pid='3930' dateline='1634347949']

Hello MiaoMiao,

Unfortunately there isn't a continuous way to map a number of pokes in a window to reward size. You can discretize the problem with an awkwardly large state machine description. Each lick moves the animal to a new state. In each state, a GlobalTimer_End event moves the animal to a matching reward state. The global timer has to start in the first state of the series.

-Josh

Got it! Thank you Josh!

Best,
Miaomiao