diff --git a/src/node/hierarchical-mobility-model.h b/src/node/hierarchical-mobility-model.h index e17555387..1502c516a 100644 --- a/src/node/hierarchical-mobility-model.h +++ b/src/node/hierarchical-mobility-model.h @@ -25,14 +25,37 @@ namespace ns3 { +/** + * \brief a hierachical mobility model. + * + * This model allows you to specify the position of a + * child object relative to a parent object. + */ class HierarchicalMobilityModel : public MobilityModel { public: static const InterfaceId iid; + /** + * \param child the "relative" mobility model + * \param parent the "reference" mobility model + */ HierarchicalMobilityModel (Ptr child, Ptr parent); + /** + * \returns the child mobility model. + * + * This allows you to get access to the position of the child + * relative to its parent. + */ Ptr GetChild (void) const; + /** + * \returns the parent mobility model. + * + * This allows you to get access to the position of the + * parent mobility model which is used as the reference + * position by the child mobility model. + */ Ptr GetParent (void) const; private: diff --git a/src/node/position.h b/src/node/position.h index 261ba2e99..884ba50b0 100644 --- a/src/node/position.h +++ b/src/node/position.h @@ -3,13 +3,37 @@ namespace ns3 { +/** + * \brief a 3d cartesian position vector + * + * Unit is meters. + */ class Position { public: - Position (double x, double y, double z); + /** + * \param _x x coordinate of position vector + * \param _y y coordinate of position vector + * \param _z z coordinate of position vector + * + * Create position vector (_x, _y, _z) + */ + Position (double _x, double _y, double _z); + /** + * Create position vector (0.0, 0.0, 0.0) + */ Position (); + /** + * x coordinate of position vector + */ double x; + /** + * y coordinate of position vector + */ double y; + /** + * z coordinate of position vector + */ double z; }; diff --git a/src/node/rectangle.h b/src/node/rectangle.h index ccceeb450..d8de57675 100644 --- a/src/node/rectangle.h +++ b/src/node/rectangle.h @@ -26,6 +26,9 @@ namespace ns3 { class Position; class Speed; +/** + * \brief a 2d rectangle + */ class Rectangle { public: @@ -35,8 +38,19 @@ public: TOP, BOTTOM }; + /** + * \param xMin x coordinates of left boundary. + * \param xMax x coordinates of right boundary. + * \param yMin y coordinates of bottom boundary. + * \param yMin y coordinates of top boundary. + * + * Create a rectangle. + */ Rectangle (double _xMin, double _xMax, double _yMin, double _yMax); + /** + * Create a zero-sized rectangle located at coordinates (0.0,0.0) + */ Rectangle (); bool IsInside (const Position &position) const; Side GetClosestSide (const Position &position) const; diff --git a/src/node/speed.h b/src/node/speed.h index c6bd45d8a..5e2ad3c45 100644 --- a/src/node/speed.h +++ b/src/node/speed.h @@ -3,13 +3,37 @@ namespace ns3 { +/** + * \brief keep track of 3d cartesian speed vectors + * + * Unit is meters/s. + */ class Speed { public: + /** + * \param _dx x coordinate of speed vector + * \param _dy y coordinate of speed vector + * \param _dz z coordinate of speed vector + * + * Create speed vector (_dx, _dy, _dz) + */ Speed (double _dx, double _dy, double _dz); + /** + * Create speed vector (0.0, 0.0, 0.0) + */ Speed (); + /** + * x coordinate of speed vector + */ double dx; + /** + * y coordinate of speed vector + */ double dy; + /** + * z coordinate of speed vector + */ double dz; }; diff --git a/src/node/static-mobility-model.h b/src/node/static-mobility-model.h index 9884c699a..d70890cc0 100644 --- a/src/node/static-mobility-model.h +++ b/src/node/static-mobility-model.h @@ -40,6 +40,7 @@ public: */ StaticMobilityModel (); /** + * \param position the initial position. * * Create a position located at coordinates (x,y,z). * Unit is meters diff --git a/src/node/static-speed-mobility-model.h b/src/node/static-speed-mobility-model.h index 1ceecbff5..74f5b51f9 100644 --- a/src/node/static-speed-mobility-model.h +++ b/src/node/static-speed-mobility-model.h @@ -30,6 +30,11 @@ namespace ns3 { +/** + * \brief a position model for which the current speed does not + * change once it has been set and until it is set again + * explicitely to a new value. + */ class StaticSpeedMobilityModel : public MobilityModel { public: @@ -55,7 +60,8 @@ public: const Speed &speed); virtual ~StaticSpeedMobilityModel (); - /* + /** + * \param speed the new speed to set. * * Set the current speed now to (dx,dy,dz) * Unit is meters/s