ns-3
ns3::GridPositionAllocator Class Reference

Allocate positions on a rectangular 2d grid. More...

#include <position-allocator.h>

Inheritance diagram for ns3::GridPositionAllocator:
Collaboration diagram for ns3::GridPositionAllocator:

List of all members.

Public Types

enum  LayoutType { ROW_FIRST, COLUMN_FIRST }

Public Member Functions

void SetMinX (double xMin)
void SetMinY (double yMin)
void SetDeltaX (double deltaX)
void SetDeltaY (double deltaY)
void SetN (uint32_t n)
void SetLayoutType (enum LayoutType layoutType)
double GetMinX (void) const
double GetMinY (void) const
double GetDeltaX (void) const
double GetDeltaY (void) const
uint32_t GetN (void) const
enum LayoutType GetLayoutType (void) const
virtual Vector GetNext (void) const

Static Public Member Functions

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

Detailed Description

Allocate positions on a rectangular 2d grid.


Member Enumeration Documentation

Determine whether positions are allocated row first or column first.

Enumerator:
ROW_FIRST 

In row-first mode, positions are allocated on the first row until N positions have been allocated. Then, the second row located a yMin + yDelta is used to allocate positions.

COLUMN_FIRST 

In column-first mode, positions are allocated on the first column until N positions have been allocated. Then, the second column located a xMin + xDelta is used to allocate positions.


Member Function Documentation

double ns3::GridPositionAllocator::GetDeltaX ( void  ) const
Returns:
the x interval between two x-consecutive positions.
double ns3::GridPositionAllocator::GetDeltaY ( void  ) const
Returns:
the y interval between two y-consecutive positions.
Returns:
the currently-selected layout type.
double ns3::GridPositionAllocator::GetMinX ( void  ) const
Returns:
the x coordinate of the first allocated position.
double ns3::GridPositionAllocator::GetMinY ( void  ) const
Returns:
the y coordinate of the first allocated position.
uint32_t ns3::GridPositionAllocator::GetN ( void  ) const
Returns:
the number of positions to allocate on each row or each column.
Vector ns3::GridPositionAllocator::GetNext ( void  ) const [virtual]
Returns:
the next chosen position.

This method _must_ be implement in subclasses.

Implements ns3::PositionAllocator.

References COLUMN_FIRST, and ROW_FIRST.

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

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

  • /NodeList/[i]/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Child/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::HierarchicalMobilityModel/Parent/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::MobilityModel/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::PositionAllocator/$ns3::GridPositionAllocator
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::RandomWaypointMobilityModel/PositionAllocator/$ns3::GridPositionAllocator

Attributes defined for this type:

  • GridWidth: The number of objects layed out on a line.
  • MinX: The x coordinate where the grid starts.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: construct write read
  • MinY: The y coordinate where the grid starts.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0
    • Flags: construct write read
  • DeltaX: The x space between objects.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: construct write read
  • DeltaY: The y space between objects.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 1
    • Flags: construct write read
  • LayoutType: The type of layout.
    • Set with class: ns3::EnumValue
    • Underlying type: RowFirst|ColumnFirst
    • Initial value: RowFirst
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::PositionAllocator.

References COLUMN_FIRST, ROW_FIRST, and ns3::TypeId::SetParent().

void ns3::GridPositionAllocator::SetDeltaX ( double  deltaX)
Parameters:
deltaXthe x interval between two x-consecutive positions.
void ns3::GridPositionAllocator::SetDeltaY ( double  deltaY)
Parameters:
deltaYthe y interval between two y-consecutive positions.
Parameters:
layoutTypethe type of layout to use (row first or column first).
void ns3::GridPositionAllocator::SetMinX ( double  xMin)
Parameters:
xMinthe x coordinate where layout will start.
void ns3::GridPositionAllocator::SetMinY ( double  yMin)
Parameters:
yMinthe y coordinate where layout will start
void ns3::GridPositionAllocator::SetN ( uint32_t  n)
Parameters:
nthe number of positions allocated on each row (or each column) before switching to the next column (or row).

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