27 #include <ns3/uinteger.h>
29 #include <ns3/assert.h>
43 .AddConstructor<Building> ()
44 .SetGroupName (
"Buildings")
45 .AddAttribute (
"NRoomsX",
"The number of rooms in the X axis.",
48 MakeUintegerChecker<uint32_t> ())
49 .AddAttribute (
"NRoomsY",
"The number of rooms in the Y axis.",
52 MakeUintegerChecker<uint32_t> ())
53 .AddAttribute (
"NFloors",
"The number of floors of this building.",
56 MakeUintegerChecker<uint32_t> ())
57 .AddAttribute (
"Id",
"The id (unique integer) of this Building.",
60 MakeUintegerChecker<uint32_t> ())
61 .AddAttribute (
"Boundaries",
"The boundaries of this Building as a value of type ns3::Box",
65 .AddAttribute (
"Type",
66 "The type of building",
72 .AddAttribute (
"ExternalWallsType",
73 "The type of material of which the external walls are made",
91 NS_FATAL_ERROR (std::endl <<
"this function is not supported any more:" << std::endl
92 <<
" Building::Building (double xMin, double xMax, double yMin, " << std::endl
93 <<
" double yMax, double zMin, double zMax)\n" << std::endl
94 <<
"so you can't do any more stuff like:" << std::endl
95 <<
"Ptr<Building> b = CreateObject<Building> ("
101 << zMax <<
")\n" << std::endl
102 <<
"Please use instead something like this:" << std::endl
103 <<
" Ptr<Building> b = CreateObject<Building> ();" << std::endl
104 <<
" b->SetBoundaries (Box ("
110 << zMax <<
"));" << std::endl <<std::endl);
259 n = floor (
m_roomsY * y/yLength) + 1;
280 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.
AttributeValue implementation for 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)
uint32_t GetId(void) const
uint16_t GetNFloors() const
void SetBoundaries(Box box)
Set the boundaries of the building.
BuildingType_t GetBuildingType() const
void SetNRoomsX(uint16_t nroomx)
virtual ~Building()
Destructor.
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 SetNRoomsY(uint16_t nroomy)
Box GetBoundaries() const
uint16_t m_roomsX
X Room coordinate.
uint16_t GetFloor(Vector position) const
uint16_t GetNRoomsX() const
uint16_t m_roomsY
Y Room coordinate.
static TypeId GetTypeId(void)
Get the type ID.
bool IsInside(Vector position) const
virtual void DoDispose()
Destructor implementation.
void SetNFloors(uint16_t nfloors)
Box m_buildingBounds
Building boundaries.
uint16_t GetRoomX(Vector position) const
BuildingType_t
Building type enum.
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,...
Ptr< const AttributeAccessor > MakeBoxAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeBoxChecker(void)
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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(int v, std::string n, Ts... args)
Make an EnumChecker pre-configured with a set of allowed values by name.
list x
Random number samples.