ns-3
ns3::UniformDiscPositionAllocator Class Reference

Allocate the positions uniformely (with constant density) randomly within a disc. More...

#include <position-allocator.h>

Inheritance diagram for ns3::UniformDiscPositionAllocator:
Collaboration diagram for ns3::UniformDiscPositionAllocator:

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

Allocate the positions uniformely (with constant density) randomly within a disc.

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

Returns:
the next chosen position.

This method _must_ be implement in subclasses.

Implements ns3::PositionAllocator.

References ns3::UniformVariable::GetValue(), and NS_LOG_DEBUG.

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
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::UniformDiscPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$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.

References ns3::TypeId::SetParent().

Parameters:
rhothe value of the radius of the disc
Parameters:
xthe X coordinate of the center of the disc
Parameters:
ythe Y coordinate of the center of the disc

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