Open mturilli opened 7 years ago
Hmm, this is actually what the sampling should do already, so this is a bug. thx!
As a side note, this is done by the resample method in pandas:
>>> series
2000-01-01 00:00:00 0
2000-01-01 00:01:00 1
2000-01-01 00:02:00 2
2000-01-01 00:03:00 3
2000-01-01 00:04:00 4
2000-01-01 00:05:00 5
2000-01-01 00:06:00 6
2000-01-01 00:07:00 7
2000-01-01 00:08:00 8
>>> series.resample('3T', label='right', closed='right').sum()
2000-01-01 00:00:00 0
2000-01-01 00:03:00 6
2000-01-01 00:06:00 15
2000-01-01 00:09:00 15
Sorry that this took so long to look into! To me it looks like the sample
parameter to the session.concurrency()
method does exactly what you are asking for. Like, I get reasonable output with different sample
values for code like this:
units = session.filter(etype='unit', inplace=False)
conc = units.concurrency(state=[rp.AGENT_EXECUTING,
rp.AGENT_STAGING_OUTPUT_PENDING],
sampling=1.0) # sampling time in seconds
Is that what you mean?
When measuring pilot concurrency, sampling returns all the timestamps within the sampling rate. For example:
When plotting this timeseries, it would be useful to have the total amount of entities in the specified state for the chosen time sample. For example: