|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
21 #include "ns3/trickle-timer.h"
56 virtual void DoRun (
void);
91 :
TestCase (
"Check the Trickle Timer algorithm")
133 std::vector<Time> expirationFrequency;
137 expirationFrequency.erase (expirationFrequency.begin ());
139 int64x64_t min = (*std::min_element (expirationFrequency.begin (), expirationFrequency.end ()))/unit;
140 int64x64_t max = (*std::max_element (expirationFrequency.begin (), expirationFrequency.end ()))/unit;
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
void Enable()
Enable the timer.
static Time Now(void)
Return the current simulation virtual time.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define NS_TEST_EXPECT_MSG_GT_OR_EQ(actual, limit, msg)
Test that an actual value is greater than or equal to limit and report if not.
static TrickleTimerTestSuite g_trickleTimerTestSuite
TrickleTimerTestSuite instance variable.
bool m_enableDataCollection
Collect data if true.
void TransientOver(void)
Function to signal that the transient is over.
void ExpireTimer(void)
Function to invoke when TrickleTimer expires.
TrickleTimerTestCase()
Constructor.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
High precision numerical type, implementing Q64.64 fixed precision.
void TestSteadyState(Time unit)
Test the steady-state.
void Reset()
Reset the timer.
double min(double x, double y)
uint8_t GetDoublings(void) const
Get the doublings of the timer.
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Simulation virtual time values and global simulation resolution.
static void Run(void)
Run the simulation.
void ConsistentEvent(Time interval, TrickleTimer *tricklePtr)
Inject in the timer a consistent event.
#define NS_TEST_EXPECT_MSG_LT_OR_EQ(actual, limit, msg)
Test that an actual value is less than or equal to a limit and report if not.
void TestRedundancy(Time unit)
Test the redundancy suppression.
Time Seconds(double value)
Construct a Time in the indicated unit.
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
std::vector< Time > m_expiredTimes
Time when TrickleTimer expired.
void SetFunction(FN fn)
Set the function to execute when the timer expires.
TrickleTimerTestSuite()
Constructor.
Trickle Timer test suite.
double max(double x, double y)
void ConsistentEvent()
Records a consistent event.
A Trickle Timer following RFC 6206.