9#ifndef BUILDING_POSITION_ALLOCATOR_H
10#define BUILDING_POSITION_ALLOCATOR_H
12#include "ns3/random-variable-stream.h"
13#include <ns3/node-container.h>
14#include <ns3/position-allocator.h>
21class UniformRandomVariable;
41 Vector
GetNext()
const override;
55 mutable std::vector<Ptr<Building>>
88 Vector
GetNext()
const override;
142 Vector
GetNext()
const override;
195 Vector
GetNext()
const override;
238 Vector
GetNext()
const override;
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.
Vector GetNext() const override
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
Ptr< Building > bptr
Pointer to the chosen building.
int64_t AssignStreams(int64_t) override
Assign a fixed random variable stream number to the random variables used by this model.
static TypeId GetTypeId()
Get the type ID.
FixedRoomPositionAllocator(uint32_t x, uint32_t y, uint32_t z, Ptr< Building > b)
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
static TypeId GetTypeId()
Get the type ID.
void SetX(Ptr< RandomVariableStream > x)
Set the random variable stream object that generates x-positions.
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.
Vector GetNext() const override
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
Allocate a set of positions.
Smart pointer class similar to boost::intrusive_ptr.
Allocate each position by randomly choosing a building from the list of all buildings,...
std::vector< Ptr< Building > > m_buildingListWithoutReplacement
List of building without replacement.
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
bool m_withReplacement
If true, the building will be randomly selected with replacement.
static TypeId GetTypeId()
Get the type ID.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
Vector GetNext() const override
RandomBuildingPositionAllocator()
Allocate each position by randomly choosing a room from the list of all buildings,...
int64_t AssignStreams(int64_t stream) override
Assign a fixed random variable stream number to the random variables used by this model.
RandomRoomPositionAllocator()
Vector GetNext() const override
std::vector< RoomInfo > m_roomListWithoutReplacement
Container of rooms.
static TypeId GetTypeId()
Get the type ID.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
Walks a given NodeContainer sequentially, and for each node allocate a new position randomly in the s...
SameRoomPositionAllocator()
NodeContainer m_nodes
Nodes container.
Ptr< UniformRandomVariable > m_rand
Provides uniform random variables.
int64_t AssignStreams(int64_t) override
Assign a fixed random variable stream number to the random variables used by this model.
Vector GetNext() const override
NodeContainer::Iterator m_nodeIt
Nodes iterator.
static TypeId GetTypeId()
Get the type ID.
a unique identifier for an interface.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< Building > b
Building.
uint32_t floor
Room (floor number)
uint32_t roomx
Room (x coord)
uint32_t roomy
Room (y coord)