How to implement a PopulationStateMonitor?

Hi, I would like to track the mean of certain state variables over the course of fairly long simulations. Using the StateMonitor class, I either have to subset the group I am recording from, or record with a low frequency, otherwise I run out of RAM. In analogy to the PopulationRateMonitor class, would it be possible to construct a PopulationStateMonitor class, ideally with a choice of aggregation functions (sum, mean, std)?

I had a look at the PopulationRateMonitor and the StateMonitor definitions, hoping that by bisecting the code for the two classes I could figure out how to construct a PopulationStateMonitor class, but both appear to be thin wrappers around the CodeRunner class, which is very hard to parse without knowing Brian’s internals.

Any and all pointers (or workarounds) would be much appreciated.

Thanks, Paul

Hi @paulbrodersen. I’d love to get this implemented, and I’ll answer you in more detail tomorrow, but for now please have a look at my answer here: Is there a way to monitor the _average_ membrane potential of a group of neurons? - #3 by mstimberg (which is in reply to a very similar question)

That will do for now! Thanks for the lightening quick response.