User-provided function in run_regularly

Hi Marcel

I’m trying to implement the suggestion you made in the following thread:

Re-run the model in a previous time segment during a long run

 Quote: " If you want to do it in C++ standalone mode, then the only way I can think of is via C++ code that 
  implements the logic. Instead of `rate = ta_img(t, i)*Hz` you’d use something like `rate = my_func(t, 
  i)*Hz` and implement `my_func` in C++ so that it looks at the recent firing rate and decides whether 
  to present the next stimulus or the same stimulus with a higher firing rate."

In that thread you pointed to the same thread of discussion with @mdepitta. I can try to digest further by going through the discussion but it would be very helpful if could provide inputs to my specific issues.