26 #include <ns3/assert.h>
29 #include <ns3/uinteger.h>
46 .AddConstructor<Building>()
47 .SetGroupName(
"Buildings")
48 .AddAttribute(
"NRoomsX",
49 "The number of rooms in the X axis.",
52 MakeUintegerChecker<uint32_t>())
53 .AddAttribute(
"NRoomsY",
54 "The number of rooms in the Y axis.",
57 MakeUintegerChecker<uint32_t>())
58 .AddAttribute(
"NFloors",
59 "The number of floors of this building.",
62 MakeUintegerChecker<uint32_t>())
64 "The id (unique integer) of this Building.",
67 MakeUintegerChecker<uint32_t>())
68 .AddAttribute(
"Boundaries",
69 "The boundaries of this Building as a value of type ns3::Box",
74 "The type of building",
84 .AddAttribute(
"ExternalWallsType",
85 "The type of material of which the external walls are made",
92 "ConcreteWithWindows",
94 "ConcreteWithoutWindows",
103 <<
"this function is not supported any more:" << std::endl
104 <<
" Building::Building (double xMin, double xMax, double yMin, " << std::endl
105 <<
" double yMax, double zMin, double zMax)\n"
107 <<
"so you can't do any more stuff like:" << std::endl
108 <<
"Ptr<Building> b = CreateObject<Building> (" << xMin <<
", " << xMax <<
", "
109 << yMin <<
", " << yMax <<
", " << zMin <<
", " << zMax <<
")\n"
111 <<
"Please use instead something like this:" << std::endl
112 <<
" Ptr<Building> b = CreateObject<Building> ();" << std::endl
113 <<
" b->SetBoundaries (Box (" << xMin <<
", " << xMax <<
", " << yMin <<
", "
114 << yMax <<
", " << zMin <<
", " << zMax <<
"));" << std::endl
262 n = floor(
m_roomsY * y / yLength) + 1;
283 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 > MakeEnumChecker(T v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)