as in chapter 2.9 of the MASON19 manual
I'm using a function like getAgitationDistribution() to display a
histogram of some variable of my model. But since it is computationally
costly to calculate, I would like that MASON only calls this function
every 10 seconds or every 100 steps.
Although I can specify in the histogram that it should only be updated
after 10 seconds, it seems that my function is still called every step
(only the graphical update is restricted to 10 second intervals). I then
added something like "if schedule.getSteps()%100==0" to my code to
perform the calculation only every 100 steps. In principle that works
but now the histogram is only correctly displayed at step 100,200,300,
etc. For all other steps it shows nonsense because in those cases I
return an empty double.
So what is the best way to solve this problem ?