![]() |
Mads
Multi-Agent Distributed System
|
Accumulates ClockSamples and returns the classic NTP "best of N": the retained sample with the smallest round-trip delay, i.e. the one least polluted by queuing delay along the path. More...
#include <clock_offset.hpp>
Public Member Functions | |
| ClockOffsetEstimator (size_t keep=8) | |
| void | add (const ClockSample &s) |
| ClockOffsetResult | best () const |
| ClockOffsetResult | median () const |
| void | reset () |
Accumulates ClockSamples and returns the classic NTP "best of N": the retained sample with the smallest round-trip delay, i.e. the one least polluted by queuing delay along the path.
Definition at line 100 of file clock_offset.hpp.
|
explicit |
| void Mads::ClockOffsetEstimator::add | ( | const ClockSample & | s | ) |
Estimates s and retains it, evicting the oldest sample once more than keep are held.
| ClockOffsetResult Mads::ClockOffsetEstimator::best | ( | ) | const |
The min-delay sample, with jitter_us/samples filled in across every retained sample. {valid=false} if add() was never called.
| ClockOffsetResult Mads::ClockOffsetEstimator::median | ( | ) | const |
The median offset_us across every retained sample (delay_us/hops/ source of the median-offset sample are carried along, for display only – best() is what should drive adoption). {valid=false} if empty.
| void Mads::ClockOffsetEstimator::reset | ( | ) |