15#include <ns3/assert.h>
18#include <ns3/uinteger.h>
35 .AddConstructor<Building>()
36 .SetGroupName(
"Buildings")
37 .AddAttribute(
"NRoomsX",
38 "The number of rooms in the X axis.",
42 .AddAttribute(
"NRoomsY",
43 "The number of rooms in the Y axis.",
47 .AddAttribute(
"NFloors",
48 "The number of floors of this building.",
53 "The id (unique integer) of this Building.",
57 .AddAttribute(
"Boundaries",
58 "The boundaries of this Building as a value of type ns3::Box",
63 "The type of building",
73 .AddAttribute(
"ExternalWallsType",
74 "The type of material of which the external walls are made",
81 "ConcreteWithWindows",
83 "ConcreteWithoutWindows",
92 <<
"this function is not supported any more:" << std::endl
93 <<
" Building::Building (double xMin, double xMax, double yMin, " << std::endl
94 <<
" double yMax, double zMin, double zMax)\n"
96 <<
"so you can't do any more stuff like:" << std::endl
97 <<
"Ptr<Building> b = CreateObject<Building> (" << xMin <<
", " << xMax <<
", "
98 << yMin <<
", " << yMax <<
", " << zMin <<
", " << zMax <<
")\n"
100 <<
"Please use instead something like this:" << std::endl
101 <<
" Ptr<Building> b = CreateObject<Building> ();" << std::endl
102 <<
" b->SetBoundaries (Box (" << xMin <<
", " << xMax <<
", " << yMin <<
", "
103 << yMax <<
", " << zMin <<
", " << zMax <<
"));" << std::endl
230 n = floor(
m_roomsX * x / xLength) + 1;
251 n = floor(
m_roomsY * y / yLength) + 1;
272 n = floor(
m_floors * z / zLength) + 1;
double yMax
The y coordinate of the top bound of the box.
bool IsInside(const Vector &position) const
double xMin
The x coordinate of the left bound of the box.
double yMin
The y coordinate of the bottom bound of the box.
double xMax
The x coordinate of the right bound of the box.
double zMin
The z coordinate of the down bound of the box.
bool IsIntersect(const Vector &l1, const Vector &l2) const
Checks if a line-segment between position l1 and position l2 intersects a box.
double zMax
The z coordinate of the up bound of the box.
Building()
Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room.
uint16_t GetNRoomsY() const
uint32_t m_buildingId
Building ID number.
BuildingType_t m_buildingType
Building type.
ExtWallsType_t GetExtWallsType() const
ExtWallsType_t
External building wall type enum.
ExtWallsType_t m_externalWalls
External building wall type.
void SetBuildingType(Building::BuildingType_t t)
uint16_t GetNFloors() const
void SetBoundaries(Box box)
Set the boundaries of the building.
BuildingType_t GetBuildingType() const
void SetNRoomsX(uint16_t nroomx)
bool IsIntersect(const Vector &l1, const Vector &l2) const
Checks if a line-segment between position l1 and position l2 intersects a building.
uint16_t GetRoomY(Vector position) const
void SetExtWallsType(Building::ExtWallsType_t t)
uint16_t m_floors
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor)
void DoDispose() override
Destructor implementation.
void SetNRoomsY(uint16_t nroomy)
Box GetBoundaries() const
uint16_t m_roomsX
X Room coordinate.
~Building() override
Destructor.
uint16_t GetFloor(Vector position) const
uint16_t GetNRoomsX() const
uint16_t m_roomsY
Y Room coordinate.
bool IsInside(Vector position) const
void SetNFloors(uint16_t nfloors)
Box m_buildingBounds
Building boundaries.
uint16_t GetRoomX(Vector position) const
BuildingType_t
Building type enum.
static TypeId GetTypeId()
Get the type ID.
static uint32_t Add(Ptr< Building > building)
Hold variables of type enum.
A base class which provides memory management and object aggregation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeBoxAccessor(T1 a1)
Ptr< const AttributeChecker > MakeBoxChecker()
Ptr< const AttributeChecker > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)