A Discrete-Event Network Simulator
API
ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT > Class Template Reference

Construct a windowed filter. More...

#include "windowed-filter.h"

+ Inheritance diagram for ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >:
+ Collaboration diagram for ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >:

Classes

struct  Sample
 sample. More...
 

Public Member Functions

 WindowedFilter ()
 contructor More...
 
 WindowedFilter (TimeDeltaT windowLength, T zeroValue, TimeT zeroTime)
 contructor More...
 
GetBest () const
 Returns Max/Min value so far among the windowed samples. More...
 
GetSecondBest () const
 Returns second Max/Min value so far among the windowed samples. More...
 
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...
 
m_zeroValue
 Uninitialized value of T. More...
 

Detailed Description

template<class T, class Compare, typename TimeT, typename TimeDeltaT>
class ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >

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;

Parameters
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.

Constructor & Destructor Documentation

◆ WindowedFilter() [1/2]

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::WindowedFilter ( )
inline

contructor

Definition at line 139 of file windowed-filter.h.

◆ WindowedFilter() [2/2]

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::WindowedFilter ( TimeDeltaT  windowLength,
zeroValue,
TimeT  zeroTime 
)
inline

contructor

Parameters
windowLengthis the period after which a best estimate expires.
zeroValueis used as the uninitialized value for objects of T. Importantly, zeroValue should be an invalid value for a true sample.
zeroTimeis the time of instance record time.

Definition at line 150 of file windowed-filter.h.

References ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_zeroValue.

Member Function Documentation

◆ GetBest()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
T ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetBest ( ) const
inline

Returns Max/Min value so far among the windowed samples.

Returns
returns Best (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().

+ Here is the caller graph for this function:

◆ GetSecondBest()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
T ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetSecondBest ( ) const
inline

Returns second Max/Min value so far among the windowed samples.

Returns
returns second Best (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.

◆ GetThirdBest()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
T ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::GetThirdBest ( ) const
inline

Returns third Max/Min value so far among the windowed samples.

Returns
returns third Best (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.

◆ Reset()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
void ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Reset ( new_sample,
TimeT  new_time 
)
inline

Resets all estimates to new sample.

Parameters
new_sampleupdate new sample.
new_timerecord 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().

+ Here is the caller graph for this function:

◆ SetWindowLength()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
void ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::SetWindowLength ( TimeDeltaT  windowLength)
inline

Changes the window length.

Does not update any current samples.

Parameters
windowLengthis 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.

◆ Update()

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
void ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::Update ( new_sample,
TimeT  new_time 
)
inline

Updates best estimates with |sample|, and expires and updates best estimates as necessary.

Parameters
new_sampleupdate new sample.
new_timerecord 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_samples

◆ m_windowLength

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
TimeDeltaT ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_windowLength

◆ m_zeroValue

template<class T , class Compare , typename TimeT , typename TimeDeltaT >
T ns3::WindowedFilter< T, Compare, TimeT, TimeDeltaT >::m_zeroValue

The documentation for this class was generated from the following file: