21#include "ns3/simulator.h"
22#include "ns3/boolean.h"
23#include "ns3/config.h"
24#include "ns3/waypoint-mobility-model.h"
44 :
TestCase (lazy ?
"Check Waypoint Mobility Model LAZY notification accuracy"
45 :
"Check Waypoint Mobility Model NON-LAZY notification accuracy"),
60 virtual void DoRun (
void);
85 mobilityFactory.
SetTypeId (
"ns3::WaypointMobilityModel");
96 Simulator::Schedule (
Seconds (0.0), &Object::Initialize, model);
109 std::vector<Ptr<MobilityModel> >::iterator i;
115 for ( std::deque<Waypoint>::iterator w =
waypoints.begin (); w !=
waypoints.end (); ++w )
122 for (
double updateTime = 0.5; updateTime <= ((
double)
waypointCount + 1.5); updateTime += 1.0 )
129 Simulator::Destroy ();
134 std::vector<Ptr<MobilityModel> >::iterator i;
154 "Course didn't change on one second time boundary with NON-LAZY notifications");
160 "Course didn't change between waypoints with LAZY notifications");
174 :
TestCase (
"Check Waypoint Mobility Model waypoint add")
187 virtual void DoRun (
void);
210 mobilityFactory.
SetTypeId (
"ns3::WaypointMobilityModel");
226 Simulator::Destroy ();
235 std::cout << now <<
" CourseChangeCallback" << std::endl;
Waypoint Mobility Model Add Waypoint Test.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
void CourseChangeCallback(Ptr< const MobilityModel > model)
Course change calback.
Ptr< MobilityModel > m_mobilityModel
mobility model
virtual ~WaypointMobilityModelAddWaypointTest()
uint32_t m_waypointCount
waypoint count
WaypointMobilityModelAddWaypointTest()
uint32_t m_waypointCounter
waypoint counter
Waypoint m_nextWaypoint
next waypoint
virtual void DoRun(void)
Implementation to actually run this TestCase.
Waypoint Mobility Model Notify Test.
void CourseChangeCallback(Ptr< const MobilityModel > model)
Course change callback.
std::deque< Waypoint > waypoints
waypoints
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t waypointCount
waypoint count
std::vector< Ptr< MobilityModel > > mobilityStack
mobilty model
virtual ~WaypointMobilityModelNotifyTest()
WaypointMobilityModelNotifyTest(bool lazy)
Constructor.
void ForceUpdates(void)
Force updates.
uint32_t mobilityCount
mobility count
bool lazyNotify
lazy notify?
AttributeValue implementation for Boolean.
Keep track of the current position and velocity of an object.
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Connect a TraceSource to a Callback without a context.
Instantiate subclasses of ns3::Object.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Smart pointer class similar to boost::intrusive_ptr.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
Simulation virtual time values and global simulation resolution.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Time time
The waypoint time.
Waypoint-based mobility model.
virtual void Update(void) const
Update the underlying state corresponding to the stored waypoints.
void AddWaypoint(const Waypoint &waypoint)
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
#define NS_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
WaypointMobilityModelTestSuite g_waypointMobilityModelTestSuite
the test suite
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Waypoint Mobility Model Test Suite.
WaypointMobilityModelTestSuite()