This commit is contained in:
Mathieu Lacage
2007-07-19 11:05:47 +02:00
parent 4e2af32bcf
commit e831a050cd
6 changed files with 94 additions and 2 deletions

View File

@@ -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<MobilityModel> child, Ptr<MobilityModel> parent);
/**
* \returns the child mobility model.
*
* This allows you to get access to the position of the child
* relative to its parent.
*/
Ptr<MobilityModel> 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<MobilityModel> GetParent (void) const;
private:

View File

@@ -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;
};

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -40,6 +40,7 @@ public:
*/
StaticMobilityModel ();
/**
* \param position the initial position.
*
* Create a position located at coordinates (x,y,z).
* Unit is meters

View File

@@ -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