20 #ifndef POSITION_ALLOCATOR_H 21 #define POSITION_ALLOCATOR_H 23 #include "ns3/object.h" 24 #include "ns3/random-variable-stream.h" 25 #include "ns3/vector.h" 50 virtual Vector
GetNext (
void)
const = 0;
94 virtual Vector
GetNext (
void)
const;
98 mutable std::vector<Vector>::const_iterator
m_current;
154 void SetN (uint32_t
n);
179 uint32_t
GetN (
void)
const;
186 virtual Vector
GetNext (
void)
const;
224 virtual Vector
GetNext (
void)
const;
262 virtual Vector
GetNext (
void)
const;
299 void SetX (
double x);
303 void SetY (
double y);
305 virtual Vector
GetNext (
void)
const;
351 void SetX (
double x);
356 void SetY (
double y);
358 virtual Vector
GetNext (
void)
const;
double GetMinY(void) const
uint32_t m_current
currently position
In column-first mode, positions are allocated on the first column until N positions have been allocat...
enum LayoutType GetLayoutType(void) const
Ptr< RandomVariableStream > m_y
pointer to y's random variable stream
Ptr< RandomVariableStream > m_y
pointer to y's random variable stream
void SetDeltaX(double deltaX)
virtual Vector GetNext(void) const =0
double GetMinX(void) const
static TypeId GetTypeId(void)
Register this type with the TypeId system.
double GetDeltaX(void) const
uint32_t GetN(void) const
Ptr< RandomVariableStream > m_theta
pointer to theta's random variable stream
void SetMinX(double xMin)
virtual ~PositionAllocator()
void SetZ(Ptr< RandomVariableStream > z)
Set the random variable stream object that generates z-positions.
std::vector< Vector > m_positions
vector of positions
Ptr< RandomVariableStream > m_rho
pointer to rho's random variable stream
void SetMinY(double yMin)
static TypeId GetTypeId(void)
Register this type with the TypeId system.
virtual ~RandomBoxPositionAllocator()
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
double m_deltaX
x interval between two consecutive x positions
virtual Vector GetNext(void) const
static TypeId GetTypeId(void)
Register this type with the TypeId system.
std::vector< Vector >::const_iterator m_current
vector iterator
void SetRho(Ptr< RandomVariableStream > rho)
Set the random variable that generates position angle.
double m_deltaY
y interval between two consecutive y positions
double m_xMin
minimum boundary on x positions
virtual Vector GetNext(void) const
static TypeId GetTypeId(void)
Register this type with the TypeId system.
void SetDeltaY(double deltaY)
uint32_t GetSize(void) const
Return the number of positions stored.
double m_x
x coordinate of center of disc
uint32_t m_n
number of positions to allocate on each row or column
Ptr< RandomVariableStream > m_x
pointer to x's random variable stream
void SetY(Ptr< RandomVariableStream > y)
Set the random variable stream object that generates y-positions.
virtual Vector GetNext(void) const
virtual ~RandomRectanglePositionAllocator()
Allocate positions on a rectangular 2d grid.
double m_yMin
minimum boundary on y positions
void SetTheta(Ptr< RandomVariableStream > theta)
Set the random variable that generates position radius.
Allocate positions from a deterministic list specified by the user.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetY(Ptr< RandomVariableStream > y)
Set the random variable stream object that generates y-positions.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
RandomDiscPositionAllocator()
static TypeId GetTypeId(void)
Register this type with the TypeId system.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
double GetDeltaY(void) const
RandomRectanglePositionAllocator()
enum LayoutType m_layoutType
currently selected layout type
static TypeId GetTypeId(void)
Register this type with the TypeId system.
double m_y
y coordinate of center of disc
Allocate random positions within a rectangle according to a pair of random variables.
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
In row-first mode, positions are allocated on the first row until N positions have been allocated...
void Add(Vector v)
Add a position to the list of positions.
virtual Vector GetNext(void) const
void SetLayoutType(enum LayoutType layoutType)
void SetX(Ptr< RandomVariableStream > x)
Set the random variable stream object that generates x-positions.
void SetX(Ptr< RandomVariableStream > x)
Set the random variable stream object that generates x-positions.
Allocate random positions within a 3D box according to a set of three random variables.
RandomBoxPositionAllocator()
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
virtual Vector GetNext(void) const
Allocate random positions within a disc according to a given distribution for the polar coordinates o...
virtual int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
LayoutType
Determine whether positions are allocated row first or column first.
virtual ~RandomDiscPositionAllocator()
Ptr< RandomVariableStream > m_z
pointer to z's random variable stream
Ptr< RandomVariableStream > m_x
pointer to x's random variable stream
Allocate a set of positions.
virtual int64_t AssignStreams(int64_t stream)=0
Assign a fixed random variable stream number to the random variables used by this model...