aboutsummaryrefslogtreecommitdiff
path: root/src/statistics/trackers.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2018-06-15 13:44:31 +0200
committerDaniel Schadt <kingdread@gmx.de>2018-06-15 13:44:31 +0200
commit4ea1d4f3e5082925874a271d14cc143ebf80912f (patch)
tree3ecdbf3af95f83848677cf2c4f786d7155084610 /src/statistics/trackers.rs
parent73db5bb9edfeb48fbf497561a12f7c9f362f4457 (diff)
downloadevtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.tar.gz
evtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.tar.bz2
evtclib-4ea1d4f3e5082925874a271d14cc143ebf80912f.zip
fix(?) boon tracking
If we throw away all empty queues before we register that they are empty, we end up never removing some boons, getting crazy uptimes. The current state is still not perfect, but it's much closer to what we expect.
Diffstat (limited to 'src/statistics/trackers.rs')
-rw-r--r--src/statistics/trackers.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/statistics/trackers.rs b/src/statistics/trackers.rs
index 5eda86c..d18e9c5 100644
--- a/src/statistics/trackers.rs
+++ b/src/statistics/trackers.rs
@@ -253,7 +253,9 @@ impl BoonTracker {
.values_mut()
.flat_map(|m| m.values_mut())
.for_each(|queue| queue.simulate(delta_t));
+ }
+ fn cleanup_queues(&mut self) {
// Throw away empty boon queues or to improve performance
self.boon_queues
.values_mut()
@@ -262,9 +264,6 @@ impl BoonTracker {
}
fn update_logs(&mut self, time: u64) {
- if time == self.last_time {
- return;
- }
for (agent, boons) in &self.boon_queues {
let agent_log = self
.boon_logs
@@ -338,8 +337,10 @@ impl Tracker for BoonTracker {
_ => (),
}
+
self.update_logs(event.time);
self.last_time = event.time;
+ self.cleanup_queues();
Ok(())
}