18#include "ns3/double.h"
39 .SetGroupName(
"Internet")
40 .AddAttribute(
"InitialEstimation",
41 "Initial RTT estimate",
77 m_initialEstimatedRtt(c.m_initialEstimatedRtt),
78 m_estimatedRtt(c.m_estimatedRtt),
79 m_estimatedVariation(c.m_estimatedVariation),
80 m_nSamples(c.m_nSamples)
122 TypeId(
"ns3::RttMeanDeviation")
124 .SetGroupName(
"Internet")
126 .AddAttribute(
"Alpha",
127 "Gain used in estimating the RTT, must be 0 <= alpha <= 1",
131 .AddAttribute(
"Beta",
132 "Gain used in estimating the RTT variation, must be 0 <= beta <= 1",
213 int64_t meas = m.GetInteger();
239 if (rttShift && variationShift)
252 NS_LOG_DEBUG(
"(first sample) m_estimatedVariation += " << m);
List of Attribute name, value and checker triples used to construct Objects.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
void ConstructSelf(const AttributeConstructionList &attributes)
Complete construction of ObjectBase; invoked by derived classes.
A base class which provides memory management and object aggregation.
friend Ptr< T > CopyObject(Ptr< T > object)
Copy an Object.
Smart pointer class similar to boost::intrusive_ptr.
Base class for all RTT Estimators.
Time m_initialEstimatedRtt
Initial RTT estimation.
Time GetEstimate() const
gets the RTT estimate.
virtual void Reset()
Resets the estimation to its initial state.
Time m_estimatedVariation
Current estimate variation.
uint32_t m_nSamples
Number of samples.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Time m_estimatedRtt
Current estimate.
Time GetVariation() const
Note that this is not a formal statistical variance; it has the the same units as the estimate.
static TypeId GetTypeId()
Get the type ID.
uint32_t GetNSamples() const
gets the number of samples used in the estimates
The "Mean--Deviation" RTT estimator, as discussed by Van Jacobson.
double m_beta
Filter gain for variation.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
void Reset() override
Resets the estimator.
void FloatingPointUpdate(Time m)
Method to update the rtt and variation estimates using floating point arithmetic, used when the value...
Ptr< RttEstimator > Copy() const override
Copy object (including current internal state)
static TypeId GetTypeId()
Get the type ID.
uint32_t CheckForReciprocalPowerOfTwo(double val) const
Utility function to check for possible conversion of a double value (0 < value < 1) to a reciprocal p...
void Measurement(Time measure) override
Add a new measurement to the estimator.
double m_alpha
Filter gain for average.
void IntegerUpdate(Time m, uint32_t rttShift, uint32_t variationShift)
Method to update the rtt and variation estimates using integer arithmetic, used when the values of Al...
Simulation virtual time values and global simulation resolution.
static Time From(const int64x64_t &value)
Create a Time in the current unit.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
int64_t GetInteger() const
Get the raw time value, in the current resolution unit.
static Time FromDouble(double value, Unit unit)
Create a Time equal to value in unit unit.
double ToDouble(Unit unit) const
Get the Time value expressed in a particular unit.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
int64x64_t Abs(const int64x64_t &value)
Absolute value.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
static const double TOLERANCE
Tolerance used to check reciprocal of two numbers.
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.