Add indoor nodes position consistence check in BuildingMobilityModel and update correspondent documentation
This commit is contained in:
@@ -134,13 +134,18 @@ It is to be noted that any other configuration (i.e., with BuildingsPropagationL
|
||||
|
||||
#. Building and nodes interactions::
|
||||
|
||||
mm->SetIndoor (building, 2, 1, 1);
|
||||
|
||||
which is equivalent to the form::
|
||||
|
||||
mm->SetIndoor (building);
|
||||
mm->SetFloorNumber (2);
|
||||
mm->SetRoomNumberX (1);
|
||||
mm->SetRoomNumberY (1);
|
||||
|
||||
This informs node's mobility model the fact that the node is inside the building at the second floor in the corner room of the 3 x 2 grid.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position and the building site, which is user's responsibility.
|
||||
This informs node's mobility model the fact that the node is inside the building at the second floor in the corner room of the 3 x 2 grid.
|
||||
We suggest the usage of the first form since it performs a consistency check of the node position with the building bounds.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position (x,y,z coordinates) and the building position and size for outdoor nodes. The responsibility of this consistency is completely left to the user.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -114,5 +114,11 @@ Building::GetNumberRoomY ()
|
||||
return (m_roomY);
|
||||
}
|
||||
|
||||
Box
|
||||
Building::GetBuildingBounds ()
|
||||
{
|
||||
return (m_buldingBounds);
|
||||
}
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -141,6 +141,12 @@ public:
|
||||
* Return the number of room in y-axis
|
||||
*/
|
||||
uint8_t GetNumberRoomY ();
|
||||
|
||||
/**
|
||||
* \return the bounds of the building
|
||||
* Return the bounds of the building as Box class
|
||||
*/
|
||||
Box GetBuildingBounds ();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -98,6 +98,22 @@ BuildingsMobilityModel::SetIndoor (Ptr<Building> building)
|
||||
m_myBuilding = building;
|
||||
}
|
||||
|
||||
void
|
||||
BuildingsMobilityModel::SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
|
||||
{
|
||||
m_indoor = true;
|
||||
m_myBuilding = building;
|
||||
m_nFloor = nfloor;
|
||||
m_roomX = nroomx;
|
||||
m_roomY = nroomy;
|
||||
|
||||
if (!building->GetBuildingBounds ().IsInside (m_helper.GetCurrentPosition ()))
|
||||
{
|
||||
NS_FATAL_ERROR ("Position of the node is inconsistent with building bounds");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BuildingsMobilityModel::SetOutdoor (void)
|
||||
{
|
||||
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
bool IsOutdoor (void);
|
||||
|
||||
void SetIndoor (Ptr<Building> building);
|
||||
void SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
|
||||
void SetOutdoor (void);
|
||||
|
||||
void SetSurroudingBuilding (Ptr<Building> building);
|
||||
|
||||
@@ -403,13 +403,18 @@ It is to be noted that using other means to configure the frequency used by the
|
||||
|
||||
#. Building and nodes interactions::
|
||||
|
||||
mm->SetIndoor (building, 2, 1, 1);
|
||||
|
||||
which is equivalent to the form::
|
||||
|
||||
mm->SetIndoor (building);
|
||||
mm->SetFloorNumber (2);
|
||||
mm->SetRoomNumberX (1);
|
||||
mm->SetRoomNumberY (1);
|
||||
|
||||
This informs the node's mobility model that the node is located inside the building on the second floor in the corner room of the 3 x 2 grid.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position (x,y,z coordinates) and the building position and size. The responsibility of this consistency is completely left to the user.
|
||||
This informs the node's mobility model that the node is located inside the building on the second floor in the corner room of the 3 x 2 grid.
|
||||
We suggest the usage of the first form since it performs a consistency check of the node position with the building bounds.
|
||||
It has to be noted that the simulator does not check the consistence between the node's position (x,y,z coordinates) and the building position and size for outdoor nodes. The responsibility of this consistency is completely left to the user.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user