9#include "ns3/building.h"
10#include "ns3/buildings-helper.h"
11#include "ns3/constant-position-mobility-model.h"
13#include "ns3/mobility-building-info.h"
14#include "ns3/mobility-helper.h"
15#include "ns3/simulator.h"
108 void DoRun()
override;
117 std::ostringstream oss;
118 oss <<
"pos=" << pib.
pos;
121 oss <<
", bid=" << pib.
bid <<
", rx=" << pib.
rx <<
", ry=" << pib.
ry <<
", fn=" << pib.
fn;
142 mobility.SetMobilityModel(
"ns3::ConstantPositionMobilityModel");
146 mobility.Install(
nodes);
150 bmm->SetPosition(
m_pib.pos);
155 b->SetNFloors(
m_bd.nf);
156 b->SetNRoomsX(
m_bd.nrx);
157 b->SetNRoomsY(
m_bd.nry);
159 bmm->AggregateObject(buildingInfo);
164 NS_LOG_LOGIC(
" got bid=" << buildingInfo->GetBuilding()->GetId()
165 <<
", f=" << (
uint32_t)buildingInfo->GetFloorNumber()
166 <<
", rx=" << (
uint32_t)buildingInfo->GetRoomNumberX()
167 <<
", roomY=" << (
uint32_t)buildingInfo->GetRoomNumberY());
172 "floor number mismatch");
175 "x room number mismatch");
178 "y room number mismatch");
211 Vector vp1(1.5, 1.5, 0.5);
221 Vector vp2(1.5, 0.5, 0.5);
227 Vector vp3(1.5, 2.5, 0.5);
233 Vector vp4(1.5, 1.5, 5);
239 Vector vp5(2.5, 1.6, 3.5);
249 Vector vp6(0.9999, 1.5, 1.5);
255 Vector vp7(3.0001, 1.5, 2.5);
261 Vector vp8(1.001, 1.001, -0.01);
267 Vector vp9(1.5, 1.5, 4.001);
284 Vector vq1(-0.7, -1.1, 1.2);
294 Vector vq2(0.2, 0.3, 0.2);
304 Vector vq3(0.6, -1.75, 1.5);
310 Vector vq4(-1.01, 0.3, 1.99);
316 Vector vq5(-0.8, 0.7, 0.01);
322 Vector vq6(0.2, 0.3, -0.2);
328 Vector vq7(0.2, 0.3, 2.001);
static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance
Static variable for test initialization.
BuildingData m_bd
Building data.
static std::string BuildNameString(PositionInBuilding pib, BuildingData bd)
Build the testcase name.
PositionInBuilding m_pib
Position in the building.
void DoRun() override
Implementation to actually run this TestCase.
BuildingsHelperOneTestCase(PositionInBuilding pib, BuildingData bd)
Constructor.
BuildingsHelper TestSuite.
BuildingsHelperTestSuite()
Mobility model for which the current position does not change once it has been set and until it is se...
Helper class used to assign positions and mobility models to nodes.
keep track of a set of node pointers.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
TestCase(const TestCase &)=delete
TestSuite(std::string name, Type type=Type::UNIT)
Construct a new test suite.
static constexpr auto UNIT
#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 ",...
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Data to construct a Building object.
double xmin
X min coordinate.
double ymin
Y min coordinate.
double zmin
Z min coordinate.
uint16_t nrx
Number of rooms (X coord)
uint16_t nry
Number of rooms (Y coord)
double zmax
Z max coordinate.
uint16_t nf
Number of floors.
double ymax
Y max coordinate.
double xmax
X max coordinate.
Struct representing a position in a building.
bool indoor
true if indoor, false otherwise
Vector pos
coordinates of the mobility model instance