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

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.

enum LayoutType ns3::GridPositionAllocator::GetLayoutType ( void   )  const

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.

virtual Vector ns3::GridPositionAllocator::GetNext ( void   )  const [virtual]

Returns:
the next chosen position.
This method _must_ be implement in subclasses.

Implements ns3::PositionAllocator.

static 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]/$ns3::MobilityModel/$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.

void ns3::GridPositionAllocator::SetDeltaX ( double  deltaX  ) 

Parameters:
deltaX the x interval between two x-consecutive positions.

void ns3::GridPositionAllocator::SetDeltaY ( double  deltaY  ) 

Parameters:
deltaY the y interval between two y-consecutive positions.

void ns3::GridPositionAllocator::SetLayoutType ( enum LayoutType  layoutType  ) 

Parameters:
layoutType the type of layout to use (row first or column first).

void ns3::GridPositionAllocator::SetMinX ( double  xMin  ) 

Parameters:
xMin the x coordinate where layout will start.

void ns3::GridPositionAllocator::SetMinY ( double  yMin  ) 

Parameters:
yMin the y coordinate where layout will start

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


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

Generated on Fri Apr 9 15:01:10 2010 for NS-3 by  doxygen 1.5.8