Construct a windowed filter. More...
#include "windowed-filter.h"
Classes | |
struct | Sample |
sample. More... | |
Public Member Functions | |
WindowedFilter () | |
contructor More... | |
WindowedFilter (TimeDeltaT windowLength, T zeroValue, TimeT zeroTime) | |
contructor More... | |
T | GetBest () const |
Returns Max/Min value so far among the windowed samples. More... | |
T | GetSecondBest () const |
Returns second Max/Min value so far among the windowed samples. More... | |
T | GetThirdBest () const |
Returns third Max/Min value so far among the windowed samples. More... | |
void | Reset (T new_sample, TimeT new_time) |
Resets all estimates to new sample. More... | |
void | SetWindowLength (TimeDeltaT windowLength) |
Changes the window length. More... | |
void | Update (T new_sample, TimeT new_time) |
Updates best estimates with |sample|, and expires and updates best estimates as necessary. More... | |
Public Attributes | |
Sample | m_samples [3] |
Best estimate is element 0. More... | |
TimeDeltaT | m_windowLength |
Time length of window. More... | |
T | m_zeroValue |
Uninitialized value of T. More... | |
Construct a windowed filter.
Use the following to construct a windowed filter object of type T. For example, a min filter using QuicTime as the time type: WindowedFilter<T, MinFilter<T>, QuicTime, QuicTime::Delta> ObjectName; max filter using 64-bit integers as the time type: WindowedFilter<T, MaxFilter<T>, uint64_t, int64_t> ObjectName;
T | – type of the measurement that is being filtered. |
Compare | – MinFilter<T> or MaxFilter<T>, depending on the type of filter desired. |
TimeT | – the type used to represent timestamps. |
TimeDeltaT | – the type used to represent continuous time intervals between two timestamps. Has to be the type of (a - b) if both |a| and |b| are of type TimeT. |
Definition at line 133 of file windowed-filter.h.
|
inline |
contructor
Definition at line 139 of file windowed-filter.h.
|
inline |
contructor
windowLength | is the period after which a best estimate expires. |
zeroValue | is used as the uninitialized value for objects of T. Importantly, zeroValue should be an invalid value for a true sample. |
zeroTime | is the time of instance record time. |
Definition at line 150 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_zeroValue.
|
inline |
Returns Max/Min value so far among the windowed samples.
Definition at line 244 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples, and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Sample::sample.
Referenced by ns3::TcpBbr::AckAggregationCwnd(), ns3::TcpBbr::CheckFullPipe(), ns3::TcpBbr::InFlight(), ns3::TcpBbr::SetPacingRate(), ns3::TcpBbr::UpdateAckAggregation(), and ns3::TcpBbr::UpdateBtlBw().
|
inline |
Returns second Max/Min value so far among the windowed samples.
Definition at line 253 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples, and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Sample::sample.
|
inline |
Returns third Max/Min value so far among the windowed samples.
Definition at line 262 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples, and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Sample::sample.
|
inline |
Resets all estimates to new sample.
new_sample | update new sample. |
new_time | record time of the new sample. |
Definition at line 235 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples.
Referenced by ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update().
|
inline |
Changes the window length.
Does not update any current samples.
windowLength | is the period after which a best estimate expires. |
Definition at line 163 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_windowLength.
|
inline |
Updates best estimates with |sample|, and expires and updates best estimates as necessary.
new_sample | update new sample. |
new_time | record time of the new sample. |
Definition at line 174 of file windowed-filter.h.
References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples, ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_windowLength, ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_zeroValue, and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Reset().
Referenced by ns3::TcpBbr::UpdateBtlBw().
Sample ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_samples[3] |
Best estimate is element 0.
Definition at line 295 of file windowed-filter.h.
Referenced by ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest(), ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetSecondBest(), ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetThirdBest(), ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Reset(), and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update().
TimeDeltaT ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_windowLength |
Time length of window.
Definition at line 293 of file windowed-filter.h.
Referenced by ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::SetWindowLength(), and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update().
T ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_zeroValue |
Uninitialized value of T.
Definition at line 294 of file windowed-filter.h.
Referenced by ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::WindowedFilter(), and ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update().