A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::Building Class Reference

a 3d building block More...

#include <building.h>

+ Inheritance diagram for ns3::Building:
+ Collaboration diagram for ns3::Building:

Public Types

enum  BuildingType_t { Residential, Office, Commercial }
 
enum  ExtWallsType_t { Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks }
 

Public Member Functions

 Building (double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
 Construct a simple building with 1 room and 1 floor. More...
 
 Building ()
 Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room. More...
 
virtual ~Building ()
 Destructor. More...
 
virtual void DoDispose ()
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
Box GetBoundaries () const
 
BuildingType_t GetBuildingType () const
 
ExtWallsType_t GetExtWallsType () const
 
uint16_t GetFloor (Vector position) const
 
uint32_t GetId (void) const
 
uint16_t GetNFloors () const
 
uint16_t GetNRoomsX () const
 
uint16_t GetNRoomsY () const
 
uint16_t GetRoomX (Vector position) const
 
uint16_t GetRoomY (Vector position) const
 
bool IsInside (Vector position) const
 
void SetBoundaries (Box box)
 Set the boundaries of the building. More...
 
void SetBuildingType (Building::BuildingType_t t)
 
void SetExtWallsType (Building::ExtWallsType_t t)
 
void SetNFloors (uint16_t nfloors)
 
void SetNRoomsX (uint16_t nroomx)
 
void SetNRoomsY (uint16_t nroomy)
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Attributes

Box m_buildingBounds
 
uint32_t m_buildingId
 
BuildingType_t m_buildingType
 
ExtWallsType_t m_externalWalls
 
uint16_t m_floors
 number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor) More...
 
uint16_t m_roomsX
 
uint16_t m_roomsY
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Detailed Description

a 3d building block

Doxygen introspection did not find any typical Config paths.


Attributes

  • NRoomsX: The number of rooms in the X axis.
  • NRoomsY: The number of rooms in the Y axis.
  • NFloors: The number of floors of this building.
  • Id: The id (unique integer) of this Building.
  • Boundaries: The boundaries of this Building as a value of type ns3::Box
    • Set with class: BoxValue
    • Underlying type: Box
    • Initial value: 0|0|0|0|0|0
    • Flags: construct write read
  • Type: The type of building
    • Set with class: ns3::EnumValue
    • Underlying type: Residential|Office|Commercial
    • Initial value: Residential
    • Flags: construct write read
  • ExternalWallsType: The type of material of which the external walls are made
    • Set with class: ns3::EnumValue
    • Underlying type: Wood|ConcreteWithWindows|ConcreteWithoutWindows|StoneBlocks
    • Initial value: ConcreteWithWindows
    • Flags: construct write read

No TraceSources are defined for this type.

Definition at line 37 of file building.h.

Member Enumeration Documentation

Enumerator
Residential 
Office 
Commercial 

Definition at line 46 of file building.h.

Enumerator
Wood 
ConcreteWithWindows 
ConcreteWithoutWindows 
StoneBlocks 

Definition at line 50 of file building.h.

Constructor & Destructor Documentation

ns3::Building::Building ( double  xMin,
double  xMax,
double  yMin,
double  yMax,
double  zMin,
double  zMax 
)

Construct a simple building with 1 room and 1 floor.

Parameters
xMinx coordinates of left boundary.
xMaxx coordinates of right boundary.
yMiny coordinates of bottom boundary.
yMaxy coordinates of top boundary.
zMinz coordinates of down boundary.
zMaxz coordinates of up boundary.

Definition at line 85 of file building.cc.

References NS_FATAL_ERROR.

ns3::Building::Building ( )

Create a zero-sized building located at coordinates (0.0,0.0,0.0) and with 1 floors and 1 room.

Definition at line 115 of file building.cc.

References ns3::BuildingList::Add(), m_buildingId, and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

ns3::Building::~Building ( )
virtual

Destructor.

Definition at line 121 of file building.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

void ns3::Building::DoDispose ( void  )
virtual

This method is called by Object::Dispose or by the object's destructor, whichever comes first.

Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.

It is safe to call GetObject from within this method.

Reimplemented from ns3::Object.

Definition at line 127 of file building.cc.

References NS_LOG_FUNCTION.

Box ns3::Building::GetBoundaries ( ) const
Returns
the boundaries of the building

Definition at line 182 of file building.cc.

References m_buildingBounds, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Building::BuildingType_t ns3::Building::GetBuildingType ( ) const
Returns
the type of building

Definition at line 189 of file building.cc.

References m_buildingType.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Building::ExtWallsType_t ns3::Building::GetExtWallsType ( ) const
Returns
the type of external walls of the building

Definition at line 195 of file building.cc.

References m_externalWalls.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint16_t ns3::Building::GetFloor ( Vector  position) const
Parameters
positiona position inside the building
Returns
the floor where the position falls

Definition at line 268 of file building.cc.

References IsInside(), m_buildingBounds, m_floors, NS_ASSERT, NS_LOG_LOGIC, ns3::Vector3D::z, ns3::Box::zMax, and ns3::Box::zMin.

+ Here is the call graph for this function:

uint32_t ns3::Building::GetId ( void  ) const
Returns
the unique id of this Building. This unique id happens to be also the index of the Building into the BuildingList.

Definition at line 133 of file building.cc.

References m_buildingId, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint16_t ns3::Building::GetNFloors ( ) const
Returns
the number of floors of the building

Definition at line 201 of file building.cc.

References m_floors.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint16_t ns3::Building::GetNRoomsX ( ) const
Returns
the number of rooms along the x-axis of the building

Definition at line 207 of file building.cc.

References m_roomsX.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint16_t ns3::Building::GetNRoomsY ( ) const
Returns
the number of rooms along the y-axis

Definition at line 213 of file building.cc.

References m_roomsY.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

uint16_t ns3::Building::GetRoomX ( Vector  position) const
Parameters
positiona position inside the building
Returns
the number of the room along the X axis where the position falls

Definition at line 226 of file building.cc.

References IsInside(), m_buildingBounds, m_roomsX, NS_ASSERT, NS_LOG_LOGIC, sample-rng-plot::x, ns3::Vector3D::x, ns3::Box::xMax, and ns3::Box::xMin.

+ Here is the call graph for this function:

uint16_t ns3::Building::GetRoomY ( Vector  position) const
Parameters
positiona position inside the building
Returns
the number of the room along the Y axis where the position falls

Definition at line 247 of file building.cc.

References IsInside(), m_buildingBounds, m_roomsY, NS_ASSERT, NS_LOG_LOGIC, ns3::Vector3D::y, ns3::Box::yMax, and ns3::Box::yMin.

+ Here is the call graph for this function:

bool ns3::Building::IsInside ( Vector  position) const
Parameters
positionsome position
Returns
true if the position fall inside the building, false otherwise

Definition at line 219 of file building.cc.

References ns3::Box::IsInside(), and m_buildingBounds.

Referenced by GetFloor(), GetRoomX(), and GetRoomY().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::Building::SetBoundaries ( Box  box)

Set the boundaries of the building.

Parameters
boxthe Box defining the boundaries of the building

Definition at line 140 of file building.cc.

References m_buildingBounds, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::Building::SetBuildingType ( Building::BuildingType_t  t)
Parameters
tthe type of building (i.e., Residential, Office, Commercial)

This method allows to set building type (default is Residential)

Definition at line 147 of file building.cc.

References m_buildingType, and NS_LOG_FUNCTION.

Referenced by GetTypeId(), and main().

+ Here is the caller graph for this function:

void ns3::Building::SetExtWallsType ( Building::ExtWallsType_t  t)
Parameters
tthe type of external walls (i.e., Wood, ConcreteWithWindows, ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss due to the penetration of external walls in outdoor <-> indoor comm.

This method allows to set external walls type (default is Residential)

Definition at line 154 of file building.cc.

References m_externalWalls, and NS_LOG_FUNCTION.

Referenced by GetTypeId(), and main().

+ Here is the caller graph for this function:

void ns3::Building::SetNFloors ( uint16_t  nfloors)
Parameters
nfloorsthe number of floors in the building

This method allows to set the number of floors in the building (default is 1)

Definition at line 161 of file building.cc.

References m_floors, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::Building::SetNRoomsX ( uint16_t  nroomx)
Parameters
nroomxthe number of rooms along the x axis

This method allows to set the number of rooms along the x-axis

Definition at line 168 of file building.cc.

References m_roomsX, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

void ns3::Building::SetNRoomsY ( uint16_t  nroomy)
Parameters
nroomythe number of floors in the building

This method allows to set the number of rooms along the y-axis

Definition at line 175 of file building.cc.

References m_roomsY, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

Member Data Documentation

Box ns3::Building::m_buildingBounds
private

Definition at line 209 of file building.h.

Referenced by GetBoundaries(), GetFloor(), GetRoomX(), GetRoomY(), IsInside(), and SetBoundaries().

uint32_t ns3::Building::m_buildingId
private

Definition at line 219 of file building.h.

Referenced by Building(), and GetId().

BuildingType_t ns3::Building::m_buildingType
private

Definition at line 220 of file building.h.

Referenced by GetBuildingType(), and SetBuildingType().

ExtWallsType_t ns3::Building::m_externalWalls
private

Definition at line 221 of file building.h.

Referenced by GetExtWallsType(), and SetExtWallsType().

uint16_t ns3::Building::m_floors
private

number of floors, must be greater than 0, and 1 means only one floor (i.e., groundfloor)

Definition at line 215 of file building.h.

Referenced by GetFloor(), GetNFloors(), and SetNFloors().

uint16_t ns3::Building::m_roomsX
private

Definition at line 216 of file building.h.

Referenced by GetNRoomsX(), GetRoomX(), and SetNRoomsX().

uint16_t ns3::Building::m_roomsY
private

Definition at line 217 of file building.h.

Referenced by GetNRoomsY(), GetRoomY(), and SetNRoomsY().


The documentation for this class was generated from the following files: