25 #include <ns3/buildings-mobility-model.h>
26 #include <ns3/building.h>
27 #include <ns3/buildings-helper.h>
28 #include <ns3/mobility-helper.h>
29 #include <ns3/simulator.h>
47 PositionInBuilding::PositionInBuilding ()
78 BuildingData::BuildingData ()
98 virtual void DoRun (
void);
107 std::ostringstream oss;
108 oss <<
"pos=" << pib.pos;
111 oss <<
", bid=" << pib.bid
114 <<
", fn=" << pib.fn;
124 BuildingsHelperOneTestCase::BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd)
125 : TestCase (BuildNameString (pib, bd)),
143 bmm->SetPosition (m_pib.pos);
147 b->SetBoundaries (
Box (m_bd.xmin, m_bd.xmax, m_bd.ymin, m_bd.ymax, m_bd.zmin, m_bd.zmax));
148 b->SetNFloors (m_bd.nf);
149 b->SetNRoomsX (m_bd.nrx);
150 b->SetNRoomsY (m_bd.nry);
152 BuildingsHelper::MakeMobilityModelConsistent ();
155 NS_TEST_ASSERT_MSG_EQ (bmm->IsIndoor (), m_pib.indoor,
"indoor/outdoor mismatch");
158 NS_LOG_LOGIC (
" got bid=" << bmm->GetBuilding ()->GetId () <<
", f=" << (uint32_t) bmm->GetFloorNumber () <<
", rx=" << (uint32_t) bmm->GetRoomNumberX () <<
", roomY=" << (uint32_t) bmm->GetRoomNumberY ());
160 NS_TEST_ASSERT_MSG_EQ (bmm->GetBuilding ()->GetId (), 0,
"Building ID mismatch");
161 NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetFloorNumber (), m_pib.fn,
"floor number mismatch");
162 NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberX (), m_pib.rx,
"x room number mismatch");
163 NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberY (), m_pib.ry,
"y room number mismatch");
182 BuildingsHelperTestSuite::BuildingsHelperTestSuite ()
198 Vector vp1 (1.5, 1.5, 0.5);
208 Vector vp2 (1.5, 0.5, 0.5);
214 Vector vp3 (1.5, 2.5, 0.5);
226 Vector vp5 (2.5, 1.6, 3.5);
236 Vector vp6 (0.9999, 1.5, 1.5);
242 Vector vp7 (3.0001, 1.5, 2.5);
248 Vector vp8 (1.001, 1.001, -0.01);
254 Vector vp9 (1.5, 1.5, 4.001);
274 Vector vq1 (-0.7, -1.1, 1.2);
284 Vector vq2 (0.2, 0.3, 0.2);
294 Vector vq3 (0.6, -1.75, 1.5);
300 Vector vq4 (-1.01, 0.3, 1.99);
306 Vector vq5 (-0.8, 0.7, 0.01);
312 Vector vq6 (0.2, 0.3, -0.2);
318 Vector vq7 (0.2, 0.3, 2.001);
325 static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance;
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
#define NS_LOG_COMPONENT_DEFINE(name)
virtual void DoRun(void)
Implementation to actually run this test case.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
Buildings mobility model.
#define NS_LOG_LOGIC(msg)
static void Destroy(void)
keep track of a set of node pointers.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual test case to this test suite.
Helper class used to assign positions and mobility models to nodes.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< T > GetObject(void) const