21 #ifndef BUILDING_POSITION_ALLOCATOR_H
22 #define BUILDING_POSITION_ALLOCATOR_H
25 #include <ns3/position-allocator.h>
26 #include <ns3/node-container.h>
27 #include "ns3/random-variable-stream.h"
32 class UniformRandomVariable;
51 virtual Vector
GetNext (
void)
const;
98 virtual Vector
GetNext (
void)
const;
152 virtual Vector
GetNext (
void)
const;
207 virtual Vector
GetNext (
void)
const;
255 virtual Vector
GetNext (
void)
const;
Generate a random position uniformly distributed in the volume of a chosen room inside a chosen build...
uint32_t floor
Index of the room on the z-axis (i.e., floor number)
uint32_t roomx
Index of the room on the x-axis.
uint32_t roomy
Index of the room on the y-axis.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
Ptr< Building > bptr
Pointer to the chosen building.
FixedRoomPositionAllocator(uint32_t x, uint32_t y, uint32_t z, Ptr< Building > b)
int64_t AssignStreams(int64_t)
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId(void)
Get the type ID.
virtual Vector GetNext(void) const
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
allocate outdoor positions
void SetY(Ptr< RandomVariableStream > y)
Set the random variable stream object that generates y-positions.
uint32_t m_maxAttempts
maximum number of attempts before giving up
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
void SetX(Ptr< RandomVariableStream > x)
Set the random variable stream object that generates x-positions.
virtual Vector GetNext(void) const
Ptr< RandomVariableStream > m_x
pointer to x's random variable stream
Ptr< RandomVariableStream > m_z
pointer to z's random variable stream
Ptr< RandomVariableStream > m_y
pointer to y's random variable stream
OutdoorPositionAllocator()
void SetZ(Ptr< RandomVariableStream > z)
Set the random variable stream object that generates z-positions.
static TypeId GetTypeId(void)
Get the type ID.
Allocate a set of positions.
Allocate each position by randomly choosing a building from the list of all buildings,...
static TypeId GetTypeId(void)
Get the type ID.
bool m_withReplacement
If true, the building will be randomly selected with replacement.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
virtual Vector GetNext(void) const
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
std::vector< Ptr< Building > > m_buildingListWithoutReplacement
List of building without replacement.
RandomBuildingPositionAllocator()
Allocate each position by randomly choosing a room from the list of all buildings,...
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
RandomRoomPositionAllocator()
std::vector< RoomInfo > m_roomListWithoutReplacement
Container of rooms.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
static TypeId GetTypeId(void)
Get the type ID.
virtual Vector GetNext(void) const
Walks a given NodeContainer sequentially, and for each node allocate a new position randomly in the s...
int64_t AssignStreams(int64_t)
Assign a fixed random variable stream number to the random variables used by this model.
SameRoomPositionAllocator()
NodeContainer m_nodes
Nodes container.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
virtual Vector GetNext(void) const
NodeContainer::Iterator m_nodeIt
Nodes iterator.
static TypeId GetTypeId(void)
Get the type ID.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
list x
Random number samples.
Ptr< Building > b
Building.
uint32_t floor
Room (floor number)
uint32_t roomx
Room (x coord)
uint32_t roomy
Room (y coord)