agility: Improve laps per hour calculation accuracy (#12246)
The agility plugin previously calculated the average laps/hr rate based on the speed of the last 10 completed laps. Since this number was too low, it regularly resulted in an inaccurate estimate. Increasing this cache of previous lap speed to 30 yields a good trade-off between accuracy over a long period of time and responsiveness to laps with outlier completion times.
This commit is contained in:
@@ -41,7 +41,7 @@ class AgilitySession
|
||||
private Instant lastLapCompleted;
|
||||
private int totalLaps;
|
||||
private int lapsTillGoal;
|
||||
private final EvictingQueue<Duration> lastLapTimes = EvictingQueue.create(10);
|
||||
private final EvictingQueue<Duration> lastLapTimes = EvictingQueue.create(30);
|
||||
private int lapsPerHour;
|
||||
|
||||
AgilitySession(Courses course)
|
||||
|
||||
Reference in New Issue
Block a user