mobility: Doxygen updates

This commit is contained in:
Robert Ammon
2017-04-15 18:47:36 -07:00
parent e0c977cf7e
commit 7778696d67
7 changed files with 246 additions and 59 deletions

View File

@@ -486,9 +486,30 @@ const double ZWGS84_MATLAB[216] = {0, 0, 0, 0, 0, 0, 6043686.27224277,
-1.55198002803211e-09, -1.55198002803211e-09};
/**
* \ingroup mobility-test
* \defgroup mobility-test mobility module tests
*/
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Geo To Cartesian Test Case
*/
class GeoToCartesianTestCase : public TestCase
{
public:
/**
* Constructor
*
* \param latitude latitude
* \param longitude longitude
* \param altitude altitude
* \param sphType sphere type
* \param i index
*/
GeoToCartesianTestCase (double latitude,
double longitude,
double altitude,
@@ -498,15 +519,23 @@ public:
private:
virtual void DoRun (void);
/**
* Name function
* \param latitude the latitude
* \param longitude the longitude
* \param altitude the altitude
* \param sphType the sphere type
* \returns the name string
*/
static std::string Name (double latitude,
double longitude,
double altitude,
GeographicPositions::EarthSpheroidType sphType);
double m_latitude;
double m_longitude;
double m_altitude;
GeographicPositions::EarthSpheroidType m_sphType;
int m_i;
double m_latitude; ///< latitude
double m_longitude; ///< longitude
double m_altitude; ///< altitude
GeographicPositions::EarthSpheroidType m_sphType; ///< spheroid type
int m_i; ///< index
};
std::string
@@ -604,7 +633,12 @@ GeoToCartesianTestCase::DoRun (void)
}
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Geo To Cartesian Test Suite
*/
class GeoToCartesianTestSuite : public TestSuite
{
public:

View File

@@ -34,8 +34,13 @@
using namespace ns3;
// Test whether course change notifications occur regardless of calls
// to Update() position (which are triggered by calls to GetPosition())
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Test whether course change notifications occur regardless of calls
* to Update() position (which are triggered by calls to GetPosition())
*/
class WaypointLazyNotifyFalse : public TestCase
{
public:
@@ -43,12 +48,21 @@ public:
virtual ~WaypointLazyNotifyFalse ();
private:
/**
* Test X position function
* \param expectedXPos the expected X position
*/
void TestXPosition (double expectedXPos);
/**
* Course change callback
* \param path the path
* \param model the mobility model
*/
void CourseChangeCallback (std::string path, Ptr<const MobilityModel> model);
virtual void DoRun (void);
Ptr<Node> m_node;
Ptr<WaypointMobilityModel> m_mob;
int m_courseChanges;
Ptr<Node> m_node; ///< mode
Ptr<WaypointMobilityModel> m_mob; ///< modility model
int m_courseChanges; ///< course changes
};
WaypointLazyNotifyFalse::WaypointLazyNotifyFalse ()
@@ -95,6 +109,12 @@ WaypointLazyNotifyFalse::DoRun (void)
Simulator::Destroy ();
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Lazy Notify True
*/
class WaypointLazyNotifyTrue : public TestCase
{
public:
@@ -102,11 +122,20 @@ public:
virtual ~WaypointLazyNotifyTrue ();
private:
/**
* Text X position function
* \param expectedXPos the expected X position
*/
void TestXPosition (double expectedXPos);
/**
* Course change callback
* \param path the path
* \param model the mobility model
*/
void CourseChangeCallback (std::string path, Ptr<const MobilityModel> model);
virtual void DoRun (void);
Ptr<Node> m_node;
Ptr<WaypointMobilityModel> m_mob;
Ptr<Node> m_node; ///< node
Ptr<WaypointMobilityModel> m_mob; ///< modility model
};
WaypointLazyNotifyTrue::WaypointLazyNotifyTrue ()
@@ -152,6 +181,12 @@ WaypointLazyNotifyTrue::DoRun (void)
Simulator::Destroy ();
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Initial Position Is Waypoint Test
*/
class WaypointInitialPositionIsWaypoint : public TestCase
{
public:
@@ -159,14 +194,24 @@ public:
virtual ~WaypointInitialPositionIsWaypoint ();
private:
/**
* Text X position function
* \param model the mobility model
* \param expectedXPos the expected X position
*/
void TestXPosition (Ptr<const WaypointMobilityModel> model, double expectedXPos);
/**
* Test number of way points
* \param model the mobility model
* \param num the number of way points
*/
void TestNumWaypoints (Ptr<const WaypointMobilityModel> model, uint32_t num);
virtual void DoRun (void);
Ptr<WaypointMobilityModel> m_mob1;
Ptr<WaypointMobilityModel> m_mob2;
Ptr<WaypointMobilityModel> m_mob3;
Ptr<WaypointMobilityModel> m_mob4;
Ptr<WaypointMobilityModel> m_mob5;
Ptr<WaypointMobilityModel> m_mob1; ///< mobility model 1
Ptr<WaypointMobilityModel> m_mob2; ///< mobility model 2
Ptr<WaypointMobilityModel> m_mob3; ///< mobility model 3
Ptr<WaypointMobilityModel> m_mob4; ///< mobility model 4
Ptr<WaypointMobilityModel> m_mob5; ///< mobility model 5
};
WaypointInitialPositionIsWaypoint::WaypointInitialPositionIsWaypoint ()
@@ -276,6 +321,12 @@ WaypointInitialPositionIsWaypoint::DoRun (void)
Simulator::Destroy ();
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Mobility Model Via Helper Test
*/
class WaypointMobilityModelViaHelper : public TestCase
{
public:
@@ -283,6 +334,11 @@ public:
virtual ~WaypointMobilityModelViaHelper ();
private:
/**
* Text X position function
* \param mob the mobility model
* \param expectedXPos the expected X position
*/
void TestXPosition (Ptr<const WaypointMobilityModel> mob, double expectedXPos);
virtual void DoRun (void);
};
@@ -354,6 +410,12 @@ WaypointMobilityModelViaHelper::DoRun (void)
Simulator::Destroy ();
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Mobility Test Suite
*/
class MobilityTestSuite : public TestSuite
{
public:
@@ -369,4 +431,4 @@ MobilityTestSuite::MobilityTestSuite ()
AddTestCase (new WaypointMobilityModelViaHelper, TestCase::QUICK);
}
static MobilityTestSuite mobilityTestSuite;
static MobilityTestSuite mobilityTestSuite; ///< the test suite

View File

@@ -35,12 +35,12 @@
using namespace ns3;
//===========================================================================
// Class: MobilityTraceTestCase
//
//
// Test case.
//===========================================================================
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Mobility Trace Test Case
*/
class MobilityTraceTestCase : public TestCase
{
@@ -107,12 +107,12 @@ MobilityTraceTestCase::DoRun (void)
}
//===========================================================================
// Class: MobilityTraceTestSuite
//
//
// Test suite.
//===========================================================================
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Mobility Trace Test Suite
*/
class MobilityTraceTestSuite : public TestSuite
{
@@ -126,4 +126,4 @@ MobilityTraceTestSuite::MobilityTraceTestSuite ()
AddTestCase (new MobilityTraceTestCase, TestCase::QUICK);
}
static MobilityTraceTestSuite mobilityTraceTestSuite;
static MobilityTraceTestSuite mobilityTraceTestSuite; ///< the test suite

View File

@@ -74,7 +74,10 @@ bool AreVectorsEqual (Vector const & actual, Vector const & limit, double tol)
}
/**
* Every test case is supposed to:
* \ingroup mobility-test
* \ingroup tests
*
* \brief Every test case is supposed to:
* 1. Generate short mobility trace file
* 2. Read it back using Ns2MobilityHelper
* 3. Check initial node positions and speeds.
@@ -91,6 +94,14 @@ public:
Vector pos; ///< reference position
Vector vel; ///< reference velocity
/**
* Constructor
*
* \param id reference ID
* \param t time
* \param p position
* \param v velocity
*/
ReferencePoint (std::string const & id, Time t, Vector const & p, Vector const & v)
: node (id),
time (t),
@@ -255,7 +266,12 @@ private:
}
};
/// The test suite
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief The test suite
*/
class Ns2MobilityHelperTestSuite : public TestSuite
{
public:
@@ -517,4 +533,4 @@ public:
AddTestCase (t, TestCase::QUICK);
}
} g_ns2TransmobilityHelperTestSuite;
} g_ns2TransmobilityHelperTestSuite; ///< the test suite

View File

@@ -46,16 +46,34 @@ NS_LOG_COMPONENT_DEFINE ("RandCartAroundGeoTest");
using namespace ns3;
// 0.1 meter tolerance for testing, which is very small compared to the maximum
// distances from origin being tested
/**
* 0.1 meter tolerance for testing, which is very small compared to the maximum
* distances from origin being tested
*/
const double TOLERANCE = 0.1;
// earth's radius in meters if modeled as a perfect sphere
/// earth's radius in meters if modeled as a perfect sphere
static const double EARTH_RADIUS = 6371e3;
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Rand Cart Around Geo Test Case
*/
class RandCartAroundGeoTestCase : public TestCase
{
public:
/**
* Constructor
*
* \param originLatitude origin latitude
* \param originLongitude origin longitude
* \param maxAltitude maximum altitude
* \param numPoints number of points
* \param maxDistFromOrigin maximum distance from origin
* \param uniRand random variable
*/
RandCartAroundGeoTestCase (double originLatitude,
double originLongitude,
double maxAltitude,
@@ -66,15 +84,22 @@ public:
private:
virtual void DoRun (void);
/**
* name function
* \param originLatitude the origin latitude
* \param originLongitude the origin longitude
* \param maxDistFromOrigin the maximum distance from the origin
* \returns the name string
*/
static std::string Name (double originLatitude,
double originLongitude,
double maxDistFromOrigin);
double m_originLatitude;
double m_originLongitude;
double m_maxAltitude;
int m_numPoints;
double m_maxDistFromOrigin;
Ptr<UniformRandomVariable> m_uniRand;
double m_originLatitude; ///< origin latitude
double m_originLongitude; ///< origin longitude
double m_maxAltitude; ///< maximum altitude
int m_numPoints; ///< number of points
double m_maxDistFromOrigin; ///< maximum distance from origin
Ptr<UniformRandomVariable> m_uniRand; ///< random number
};
std::string
@@ -143,7 +168,12 @@ RandCartAroundGeoTestCase::DoRun (void)
}
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Rand Cart Around Geo Test Suite
*/
class RandCartAroundGeoTestSuite : public TestSuite
{
public:
@@ -174,4 +204,4 @@ RandCartAroundGeoTestSuite::RandCartAroundGeoTestSuite ()
}
}
static RandCartAroundGeoTestSuite g_RandCartAroundGeoTestSuite;
static RandCartAroundGeoTestSuite g_RandCartAroundGeoTestSuite; ///< the test suite

View File

@@ -28,6 +28,12 @@
using namespace ns3;
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Steady State Random Waypoint Test
*/
class SteadyStateRandomWaypointTest : public TestCase
{
public:
@@ -36,11 +42,12 @@ public:
virtual ~SteadyStateRandomWaypointTest () {}
private:
std::vector<Ptr<MobilityModel> > mobilityStack;
double count;
std::vector<Ptr<MobilityModel> > mobilityStack; ///< modility model
double count; ///< count
private:
virtual void DoRun (void);
virtual void DoTeardown (void);
/// Distribution compare function
void DistribCompare ();
};
@@ -137,10 +144,16 @@ SteadyStateRandomWaypointTest::DistribCompare ()
NS_TEST_EXPECT_MSG_EQ_TOL (dev_v, 4.4, 0.22, "Got unexpected velocity standard deviation");
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Steady State Random Waypoint Test Suite
*/
struct SteadyStateRandomWaypointTestSuite : public TestSuite
{
SteadyStateRandomWaypointTestSuite () : TestSuite ("steady-state-rwp-mobility-model", UNIT)
{
AddTestCase (new SteadyStateRandomWaypointTest, TestCase::QUICK);
}
} g_steadyStateRandomWaypointTestSuite;
} g_steadyStateRandomWaypointTestSuite; ///< the test suite

View File

@@ -26,9 +26,20 @@
using namespace ns3;
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Mobility Model Notify Test
*/
class WaypointMobilityModelNotifyTest : public TestCase
{
public:
/**
* Constructor
*
* \param lazy lazy?
*/
WaypointMobilityModelNotifyTest (bool lazy)
: TestCase (lazy ? "Check Waypoint Mobility Model LAZY notification accuracy"
: "Check Waypoint Mobility Model NON-LAZY notification accuracy"),
@@ -40,15 +51,20 @@ public:
}
private:
std::vector<Ptr<MobilityModel> > mobilityStack;
uint32_t mobilityCount;
uint32_t waypointCount;
std::deque<Waypoint> waypoints;
bool lazyNotify;
std::vector<Ptr<MobilityModel> > mobilityStack; ///< mobilty model
uint32_t mobilityCount; ///< mobility count
uint32_t waypointCount; ///< waypoint count
std::deque<Waypoint> waypoints; ///< waypoints
bool lazyNotify; ///< lazy notify?
private:
virtual void DoRun (void);
virtual void DoTeardown (void);
/// Force updates
void ForceUpdates (void);
/**
* Course cange callback
* \param model the mobility model
*/
void CourseChangeCallback (Ptr<const MobilityModel> model);
};
@@ -145,6 +161,12 @@ WaypointMobilityModelNotifyTest::CourseChangeCallback (Ptr<const MobilityModel>
}
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Mobility Model Add Waypoint Test
*/
class WaypointMobilityModelAddWaypointTest : public TestCase
{
public:
@@ -157,13 +179,17 @@ public:
}
private:
Ptr<MobilityModel> m_mobilityModel;
uint32_t m_waypointCount;
uint32_t m_waypointCounter;
Waypoint m_nextWaypoint;
Ptr<MobilityModel> m_mobilityModel; ///< mobility model
uint32_t m_waypointCount; ///< waypoint count
uint32_t m_waypointCounter; ///< waypoint counter
Waypoint m_nextWaypoint; ///< next waypoint
private:
virtual void DoRun (void);
virtual void DoTeardown (void);
/**
* Course change calback
* \param model the mobility model
*/
void CourseChangeCallback (Ptr<const MobilityModel> model);
};
@@ -219,6 +245,12 @@ WaypointMobilityModelAddWaypointTest::CourseChangeCallback (Ptr<const MobilityMo
}
}
/**
* \ingroup mobility-test
* \ingroup tests
*
* \brief Waypoint Mobility Model Test Suite
*/
static struct WaypointMobilityModelTestSuite : public TestSuite
{
WaypointMobilityModelTestSuite () : TestSuite ("waypoint-mobility-model", UNIT)
@@ -227,4 +259,4 @@ static struct WaypointMobilityModelTestSuite : public TestSuite
AddTestCase (new WaypointMobilityModelNotifyTest (false), TestCase::QUICK);
AddTestCase (new WaypointMobilityModelAddWaypointTest (), TestCase::QUICK);
}
} g_waypointMobilityModelTestSuite;
} g_waypointMobilityModelTestSuite; ///< the test suite