doxygen a couple of missing functions. Add acouple of more comments to existing mobility models
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed Jun 04 12:29:07 2008 -0700 (20 months ago)
changeset 32268c191779d1c2
parent 3225 05651cb8006b
child 3227 da8b4171e92c
doxygen a couple of missing functions. Add acouple of more comments to existing mobility models
src/mobility/random-walk-2d-mobility-model.h
src/mobility/random-waypoint-mobility-model.h
src/mobility/rectangle.cc
src/mobility/rectangle.h
src/mobility/vector.h
     1.1 --- a/src/mobility/random-walk-2d-mobility-model.h	Wed Jun 04 11:59:31 2008 -0700
     1.2 +++ b/src/mobility/random-walk-2d-mobility-model.h	Wed Jun 04 12:29:07 2008 -0700
     1.3 @@ -37,8 +37,10 @@
     1.4   * Each instance moves with a speed and direction choosen at random
     1.5   * with the user-provided random variables until
     1.6   * either a fixed distance has been walked or until a fixed amount
     1.7 - * of time.
     1.8 - *
     1.9 + * of time. If we hit one of the boundaries (specified by a rectangle),
    1.10 + * of the model, we rebound on the boundary with a reflexive angle
    1.11 + * and speed. This model is often identified as a brownian motion
    1.12 + * model.
    1.13   */
    1.14  class RandomWalk2dMobilityModel : public MobilityModel 
    1.15  {
     2.1 --- a/src/mobility/random-waypoint-mobility-model.h	Wed Jun 04 11:59:31 2008 -0700
     2.2 +++ b/src/mobility/random-waypoint-mobility-model.h	Wed Jun 04 12:29:07 2008 -0700
     2.3 @@ -38,7 +38,8 @@
     2.4   *
     2.5   * The implementation of this model is not 2d-specific. i.e. if you provide
     2.6   * a 3d random waypoint position model to this mobility model, the model 
     2.7 - * will still work.
     2.8 + * will still work. There is no 3d position allocator for now but it should
     2.9 + * be trivial to add one.
    2.10   */
    2.11  class RandomWaypointMobilityModel : public MobilityModel
    2.12  {
     3.1 --- a/src/mobility/rectangle.cc	Wed Jun 04 11:59:31 2008 -0700
     3.2 +++ b/src/mobility/rectangle.cc	Wed Jun 04 12:29:07 2008 -0700
     3.3 @@ -86,6 +86,7 @@
     3.4  Vector
     3.5  Rectangle::CalculateIntersection (const Vector &current, const Vector &speed) const
     3.6  {
     3.7 +  NS_ASSERT (IsInside (current));
     3.8    double xMaxY = current.y + (this->xMax - current.x) / speed.x * speed.y;
     3.9    double xMinY = current.y + (this->xMin - current.x) / speed.x * speed.y;
    3.10    double yMaxX = current.x + (this->yMax - current.y) / speed.y * speed.x;
     4.1 --- a/src/mobility/rectangle.h	Wed Jun 04 11:59:31 2008 -0700
     4.2 +++ b/src/mobility/rectangle.h	Wed Jun 04 12:29:07 2008 -0700
     4.3 @@ -53,13 +53,42 @@
     4.4     * Create a zero-sized rectangle located at coordinates (0.0,0.0)
     4.5     */
     4.6    Rectangle ();
     4.7 +  /**
     4.8 +   * \param position the position to test.
     4.9 +   * \returns true if the input position is located within the rectangle, 
    4.10 +   *          false otherwise.
    4.11 +   *
    4.12 +   * This method compares only the x and y coordinates of the input position.
    4.13 +   * It ignores the z coordinate.
    4.14 +   */
    4.15    bool IsInside (const Vector &position) const;
    4.16 +  /**
    4.17 +   * \param position the position to test.
    4.18 +   * \returns the side of the rectangle the input position is closest to.
    4.19 +   *
    4.20 +   * This method compares only the x and y coordinates of the input position.
    4.21 +   * It ignores the z coordinate.
    4.22 +   */
    4.23    Side GetClosestSide (const Vector &position) const;
    4.24 +  /**
    4.25 +   * \param current the current position
    4.26 +   * \param speed the current speed
    4.27 +   * \returns the intersection point between the rectangle and the current+speed vector.
    4.28 +   *
    4.29 +   * This method assumes that the current position is located _inside_
    4.30 +   * the rectangle and checks for this with an assert.
    4.31 +   * This method compares only the x and y coordinates of the input position
    4.32 +   * and speed. It ignores the z coordinate.
    4.33 +   */
    4.34    Vector CalculateIntersection (const Vector &current, const Vector &speed) const;
    4.35  
    4.36 +  /* The x coordinate of the left bound of the rectangle */
    4.37    double xMin;
    4.38 +  /* The x coordinate of the right bound of the rectangle */
    4.39    double xMax;
    4.40 +  /* The y coordinate of the bottom bound of the rectangle */
    4.41    double yMin;
    4.42 +  /* The y coordinate of the top bound of the rectangle */
    4.43    double yMax;
    4.44  };
    4.45  
     5.1 --- a/src/mobility/vector.h	Wed Jun 04 11:59:31 2008 -0700
     5.2 +++ b/src/mobility/vector.h	Wed Jun 04 12:29:07 2008 -0700
     5.3 @@ -59,6 +59,11 @@
     5.4    double z;
     5.5  };
     5.6  
     5.7 +/**
     5.8 + * \param a one point
     5.9 + * \param b another point
    5.10 + * \returns the cartesian distance between a and b.
    5.11 + */
    5.12  double CalculateDistance (const Vector &a, const Vector &b);
    5.13  
    5.14  /**