21 #include "ns3/simulator.h"
22 #include "ns3/boolean.h"
23 #include "ns3/config.h"
24 #include "ns3/waypoint-mobility-model.h"
33 :
TestCase (lazy ?
"Check Waypoint Mobility Model LAZY notification accuracy"
34 :
"Check Waypoint Mobility Model NON-LAZY notification accuracy"),
49 virtual void DoRun (
void);
69 mobilityFactory.
SetTypeId (
"ns3::WaypointMobilityModel");
88 wpt.
time += Seconds (1.0);
93 std::vector<Ptr<MobilityModel> >::iterator i;
105 for (
double updateTime = 0.5; updateTime <= ((double)waypointCount + 1.5); updateTime += 1.0 )
110 Config::Connect (
"/NodeList/*/$ns3::WaypointMobilityModel/CourseChange",
120 std::vector<Ptr<MobilityModel> >::iterator i;
140 "Course didn't change on one second time boundary with NON-LAZY notifcations");
146 "Course didn't change between waypoints with LAZY notifications");
std::vector< Ptr< MobilityModel > > mobilityStack
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
void AddWaypoint(const Waypoint &waypoint)
static void Run(void)
Run the simulation until one of:
void SetTypeId(TypeId tid)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
void Connect(std::string path, const CallbackBase &cb)
Keep track of the current position and velocity of an object.
double GetSeconds(void) const
ns3::WaypointMobilityModelTestSuite g_waypointMobilityModelTestSuite
Ptr< Object > Create(void) const
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
virtual ~WaypointMobilityModelNotifyTest()
WaypointMobilityModelTestSuite()
void Set(std::string name, const AttributeValue &value)
static Time Now(void)
Return the "current simulation time".
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
instantiate subclasses of ns3::Object.
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
void Initialize(void)
This method calls the virtual DoInitialize method on all the objects aggregated to this object...
Waypoint-based mobility model.
std::deque< Waypoint > waypoints
WaypointMobilityModelNotifyTest(bool lazy)
This test suite implements a Unit Test.
void CourseChangeCallback(std::string path, Ptr< const MobilityModel > model)
Ptr< T > GetObject(void) const
virtual void DoRun(void)
Implementation to actually run this TestCase.