Public Member Functions | Static Public Member Functions

ns3::UniformDiscPositionAllocator Class Reference

#include <position-allocator.h>

Inheritance diagram for ns3::UniformDiscPositionAllocator:
Inheritance graph
[legend]
Collaboration diagram for ns3::UniformDiscPositionAllocator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void SetRho (double rho)
void SetX (double x)
void SetY (double y)
virtual Vector GetNext (void) const

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::UniformDiscPositionAllocator.

Detailed Description

UniformDiscPositionAllocator allocates the positions randomly within a disc $ D $ lying on the plane $ z=0 $ and having center at coordinates $ (x,y,0) $ and radius $ \rho $. The random positions are chosen such that, for any subset $ S \subset D $, the expected value of the fraction of points which fall into $ S \subset D $ corresponds to $ \frac{|S|}{|D|} $, i.e., to the ratio of the area of the subset to the area of the whole disc.

Note:
using UniformDiscPositionAllocator is not equivalent to using a RandomDiscPositionAllocator with a uniformly-distributed radius, since doing that would results in a point distribution which is more dense towards the center of the disc.

Member Function Documentation

virtual Vector ns3::UniformDiscPositionAllocator::GetNext ( void   )  const [virtual]
Returns:
the next chosen position.

This method _must_ be implement in subclasses.

Implements ns3::PositionAllocator.

static TypeId ns3::UniformDiscPositionAllocator::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::UniformDiscPositionAllocator.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator

Attributes defined for this type:

  • rho: The radius of the disc
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • X: The x coordinate of the center of the disc.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • Y: The y coordinate of the center of the disc.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::PositionAllocator.

void ns3::UniformDiscPositionAllocator::SetRho ( double  rho  ) 
Parameters:
rho the value of the radius of the disc
void ns3::UniformDiscPositionAllocator::SetX ( double  x  ) 
Parameters:
x the X coordinate of the center of the disc
void ns3::UniformDiscPositionAllocator::SetY ( double  y  ) 
Parameters:
y the Y coordinate of the center of the disc

The documentation for this class was generated from the following files: