Index: src/mobility/helper/ns2-mobility-helper.cc |
=================================================================== |
--- a/src/mobility/helper/ns2-mobility-helper.cc |
+++ b/src/mobility/helper/ns2-mobility-helper.cc |
@@ -103,21 +103,30 @@ |
/** |
* Parses a line of ns2 mobility |
+ * |
+ * \param str the line to parse |
+ * \returns the parse results |
*/ |
static ParseResult ParseNs2Line (const std::string& str); |
/** |
* Put out blank spaces at the start and end of a line |
+ * |
+ * \param str the line to parse |
+ * \returns the trimmed line |
*/ |
static std::string TrimNs2Line (const std::string& str); |
/** |
* Checks if a string represents a number or it has others characters than digits an point. |
+ * |
+ * \param s the string to examine |
+ * \returns true if the string is a number |
*/ |
static bool IsNumber (const std::string& s); |
/** |
- * Check if s string represents a numeric value |
+ * Check if a string represents a numeric value |
* \param str string to check |
* \param ret numeric value to return |
* \return true if string represents a numeric value |
@@ -127,57 +136,102 @@ |
/** |
* Checks if the value between brackets is a correct nodeId number |
+ * |
+ * \param str string to check |
+ * \return true if string is a correct node ID number |
*/ |
static bool HasNodeIdNumber (std::string str); |
/** |
* Gets nodeId number in string format from the string like $node_(4) |
+ * |
+ * \param str string to check |
+ * \return node ID number string |
*/ |
static std::string GetNodeIdFromToken (std::string str); |
/** |
* Get node id number in int format |
+ * |
+ * \param pr parse results to check |
+ * \return node ID number |
*/ |
static int GetNodeIdInt (ParseResult pr); |
/** |
* Get node id number in string format |
+ * |
+ * \param pr parse results to check |
+ * \return node ID number string |
*/ |
static std::string GetNodeIdString (ParseResult pr); |
/** |
* Add one coord to a vector position |
+ * |
+ * \param actPos the current position |
+ * \param coord the coordiantes string |
+ * \param value the value to set |
+ * \returns the updated vector |
*/ |
static Vector SetOneInitialCoord (Vector actPos, std::string& coord, double value); |
/** |
* Check if this corresponds to a line like this: $node_(0) set X_ 123 |
+ * |
+ * \param pr parse results to check |
+ * \return true if the line is an initial position event |
*/ |
static bool IsSetInitialPos (ParseResult pr); |
/** |
* Check if this corresponds to a line like this: $ns_ at 1 "$node_(0) setdest 2 3 4" |
+ * |
+ * \param pr parse results to check |
+ * \return true if the line is an schedule position event |
*/ |
static bool IsSchedSetPos (ParseResult pr); |
/** |
* Check if this corresponds to a line like this: $ns_ at 1 "$node_(0) set X_ 2" |
+ * |
+ * \param pr parse results to check |
+ * \return true if the line is an schedule modility event |
*/ |
static bool IsSchedMobilityPos (ParseResult pr); |
/** |
* Set waypoints and speed for movement. |
+ * |
+ * \param model the mobility model |
+ * \param lastPos the last position |
+ * \param at the time |
+ * \param xFinalPosition the final x position |
+ * \param yFinalPosition the final y position |
+ * \param speed the speed of the node |
+ * \returns the updated destination |
*/ |
static DestinationPoint SetMovement (Ptr<ConstantVelocityMobilityModel> model, Vector lastPos, double at, |
double xFinalPosition, double yFinalPosition, double speed); |
/** |
* Set initial position for a node |
+ * |
+ * \param model the mobility model |
+ * \param coord the initial position string |
+ * \param coordVal the initial coordiante value |
+ * \returns vector of the initial position |
*/ |
static Vector SetInitialPosition (Ptr<ConstantVelocityMobilityModel> model, std::string coord, double coordVal); |
/** |
* Schedule a set of position for a node |
+ * |
+ * \param model the mobility model |
+ * \param at the time |
+ * \param coord the initial position string |
+ * \param coordVal the initial coordiante value |
+ * \returns vector of the initial position |
*/ |
static Vector SetSchedPosition (Ptr<ConstantVelocityMobilityModel> model, double at, std::string coord, double coordVal); |