27 #include <ns3/uinteger.h>
29 #include <ns3/assert.h>
45 .AddConstructor<Building> ()
46 .AddAttribute (
"NRoomsX",
"The number of rooms in the X axis.",
49 MakeUintegerChecker<uint32_t> ())
50 .AddAttribute (
"NRoomsY",
"The number of rooms in the Y axis.",
53 MakeUintegerChecker<uint32_t> ())
54 .AddAttribute (
"NFloors",
"The number of floors of this building.",
57 MakeUintegerChecker<uint32_t> ())
58 .AddAttribute (
"Id",
"The id (unique integer) of this Building.",
61 MakeUintegerChecker<uint32_t> ())
62 .AddAttribute (
"Boundaries",
"The boundaries of this Building as a value of type ns3::Box",
66 .AddAttribute (
"Type",
67 "The type of building",
73 .AddAttribute (
"ExternalWallsType",
74 "The type of material of which the external walls are made",
92 NS_FATAL_ERROR (std::endl <<
"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" << std::endl
95 <<
"so you can't do any more stuff like:" << std::endl
96 <<
"Ptr<Building> b = CreateObject<Building> ("
102 << zMax <<
")\n" << std::endl
103 <<
"Please use instead something like this:" << std::endl
104 <<
" Ptr<Building> b = CreateObject<Building> ();" << std::endl
105 <<
" b->SetBoundaries (Box ("
111 << zMax <<
"));" << std::endl <<std::endl);
239 n = floor (
m_roomsX * x/xLength) + 1;
260 n = floor (
m_roomsY * y/yLength) + 1;
281 n = floor (
m_floors * z/zLength) + 1;
uint16_t GetNFloors() const
double x
x coordinate of vector
#define NS_LOG_FUNCTION(parameters)
Ptr< const AttributeChecker > MakeEnumChecker(int v1, std::string n1, int v2, std::string n2, int v3, std::string n3, int v4, std::string n4, int v5, std::string n5, int v6, std::string n6, int v7, std::string n7, int v8, std::string n8, int v9, std::string n9, int v10, std::string n10, int v11, std::string n11, int v12, std::string n12, int v13, std::string n13, int v14, std::string n14, int v15, std::string n15, int v16, std::string n16, int v17, std::string n17, int v18, std::string n18, int v19, std::string n19, int v20, std::string n20, int v21, std::string n21, int v22, std::string n22)
void SetNRoomsY(uint16_t nroomy)
ExtWallsType_t GetExtWallsType() const
#define NS_ASSERT(condition)
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
uint16_t GetRoomY(Vector position) const
bool IsInside(Vector position) const
#define NS_FATAL_ERROR(msg)
fatal error handling
uint16_t m_floors
number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor) ...
virtual void DoDispose()
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
hold variables of type 'enum'
NS_LOG_COMPONENT_DEFINE("Building")
uint16_t GetNRoomsX() const
BuildingType_t m_buildingType
Hold an unsigned integer type.
void SetNFloors(uint16_t nfloors)
hold objects of type ns3::Box
#define NS_LOG_LOGIC(msg)
void SetExtWallsType(Building::ExtWallsType_t t)
static TypeId GetTypeId(void)
double y
y coordinate of vector
ExtWallsType_t m_externalWalls
Ptr< const AttributeAccessor > MakeEnumAccessor(T1 a1)
static uint32_t Add(Ptr< Building > building)
uint16_t GetRoomX(Vector position) const
Box GetBoundaries() const
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
void SetNRoomsX(uint16_t nroomx)
virtual ~Building()
Destructor.
a base class which provides memory management and object aggregation
uint32_t GetId(void) const
uint16_t GetFloor(Vector position) const
bool IsInside(const Vector &position) const
a unique identifier for an interface.
void SetBoundaries(Box box)
Set the boundaries of the building.
TypeId SetParent(TypeId tid)
double z
z coordinate of vector
BuildingType_t GetBuildingType() const
void SetBuildingType(Building::BuildingType_t t)