19 #include "ns3/core-module.h"
20 #include "ns3/internet-module.h"
21 #include "ns3/rtt-estimator.h"
36 virtual void DoRun (
void);
37 virtual void DoTeardown (
void);
45 RttTestCase::RttTestCase (
double mean,
50 m_variance (variance),
59 Config::SetDefault (
"ns3::RttMeanDeviation::Gain",
DoubleValue (m_gain));
65 nv->SetAttribute (
"Variance",
DoubleValue (m_variance));
73 for (uint32_t i = 0; i < 10000; ++i)
75 int measurement = nv->GetInteger ();
76 rtt->
Measurement (Time::FromInteger (measurement, Time::MS));
77 double err = (measurement - a);
79 v = v + g * (std::abs (err) - v);
83 double tolerance = m_mean * .05;
87 int expectedTimeout = (int)a + 4 * (
int)v;
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_COMPONENT_DEFINE(name)
TestSuite(std::string name, Type type=UNIT)
Constuct a new test suite.
virtual void DoRun(void)
Implementation to actually run this test case.
hold objects of type ns3::Time
Time GetCurrentEstimate(void) const
gets the current RTT estimate.
Time RetransmitTimeout()
Returns the estimated RTO.
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
void Measurement(Time measure)
Add a new measurement to the estimator.
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Time MilliSeconds(uint64_t ms)
create ns3::Time instances in units of milliseconds.
Hold an floating point type.
int64_t GetMilliSeconds(void) const
virtual void DoTeardown(void)
Implementation to do any local setup required for this test case.