ns3::GridPositionAllocator Class Reference

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

#include <position-allocator.h>

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

List of all members.

Public Types

enum  LayoutType { ROW_FIRST, COLUMN_FIRST }

Public Member Functions

 GridPositionAllocator ()
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.

Private Attributes

uint32_t m_current
enum LayoutType m_layoutType
double m_xMin
double m_yMin
uint32_t m_n
double m_deltaX
double m_deltaY

Detailed Description

Allocate positions on a rectangular 2d grid.

Definition at line 75 of file position-allocator.h.


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.

Definition at line 83 of file position-allocator.h.


Constructor & Destructor Documentation

ns3::GridPositionAllocator::GridPositionAllocator (  ) 

Definition at line 117 of file position-allocator.cc.


Member Function Documentation

double ns3::GridPositionAllocator::GetDeltaX ( void   )  const
Returns:
the x interval between two x-consecutive positions.

Definition at line 163 of file position-allocator.cc.

References m_deltaX.

double ns3::GridPositionAllocator::GetDeltaY ( void   )  const
Returns:
the y interval between two y-consecutive positions.

Definition at line 168 of file position-allocator.cc.

References m_deltaY.

enum GridPositionAllocator::LayoutType ns3::GridPositionAllocator::GetLayoutType ( void   )  const
Returns:
the currently-selected layout type.

Definition at line 178 of file position-allocator.cc.

References m_layoutType.

double ns3::GridPositionAllocator::GetMinX ( void   )  const
Returns:
the x coordinate of the first allocated position.

Definition at line 153 of file position-allocator.cc.

References m_xMin.

double ns3::GridPositionAllocator::GetMinY ( void   )  const
Returns:
the y coordinate of the first allocated position.

Definition at line 158 of file position-allocator.cc.

References m_yMin.

uint32_t ns3::GridPositionAllocator::GetN ( void   )  const
Returns:
the number of positions to allocate on each row or each column.

Definition at line 173 of file position-allocator.cc.

References m_n.

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

This method _must_ be implement in subclasses.

Implements ns3::PositionAllocator.

Definition at line 184 of file position-allocator.cc.

References COLUMN_FIRST, m_current, m_deltaX, m_deltaY, m_layoutType, m_n, m_xMin, m_yMin, and ROW_FIRST.

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

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]/$ns3MobilityModel/$ns3RandomWaypointMobilityModel/Position/$ns3GridPositionAllocator

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.

Definition at line 83 of file position-allocator.cc.

References ns3::TypeId::AddAttribute(), ns3::TypeId::AddConstructor(), COLUMN_FIRST, m_deltaX, m_deltaY, m_layoutType, m_n, m_xMin, m_yMin, ns3::MakeEnumAccessor(), ns3::MakeEnumChecker(), ROW_FIRST, and ns3::TypeId::SetParent().

void ns3::GridPositionAllocator::SetDeltaX ( double  deltaX  ) 
Parameters:
deltaX the x interval between two x-consecutive positions.

Definition at line 132 of file position-allocator.cc.

References m_deltaX.

void ns3::GridPositionAllocator::SetDeltaY ( double  deltaY  ) 
Parameters:
deltaY the y interval between two y-consecutive positions.

Definition at line 137 of file position-allocator.cc.

References m_deltaY.

void ns3::GridPositionAllocator::SetLayoutType ( enum LayoutType  layoutType  ) 
Parameters:
layoutType the type of layout to use (row first or column first).

Definition at line 147 of file position-allocator.cc.

References m_layoutType.

void ns3::GridPositionAllocator::SetMinX ( double  xMin  ) 
Parameters:
xMin the x coordinate where layout will start.

Definition at line 122 of file position-allocator.cc.

References m_xMin.

void ns3::GridPositionAllocator::SetMinY ( double  yMin  ) 
Parameters:
yMin the y coordinate where layout will start

Definition at line 127 of file position-allocator.cc.

References m_yMin.

void ns3::GridPositionAllocator::SetN ( uint32_t  n  ) 
Parameters:
n the number of positions allocated on each row (or each column) before switching to the next column (or row).

Definition at line 142 of file position-allocator.cc.

References m_n.


Member Data Documentation

uint32_t ns3::GridPositionAllocator::m_current [mutable, private]

Definition at line 154 of file position-allocator.h.

Referenced by GetNext().

Definition at line 159 of file position-allocator.h.

Referenced by GetDeltaX(), GetNext(), GetTypeId(), and SetDeltaX().

Definition at line 160 of file position-allocator.h.

Referenced by GetDeltaY(), GetNext(), GetTypeId(), and SetDeltaY().

Definition at line 155 of file position-allocator.h.

Referenced by GetLayoutType(), GetNext(), GetTypeId(), and SetLayoutType().

uint32_t ns3::GridPositionAllocator::m_n [private]

Definition at line 158 of file position-allocator.h.

Referenced by GetN(), GetNext(), GetTypeId(), and SetN().

Definition at line 156 of file position-allocator.h.

Referenced by GetMinX(), GetNext(), GetTypeId(), and SetMinX().

Definition at line 157 of file position-allocator.h.

Referenced by GetMinY(), GetNext(), GetTypeId(), and SetMinY().


The documentation for this class was generated from the following files:
Generated on Thu Dec 3 14:11:55 2009 for NS-3 by  doxygen 1.6.3