8#include "ns3/boolean.h"
9#include "ns3/building.h"
10#include "ns3/buildings-channel-condition-model.h"
11#include "ns3/channel-condition-model.h"
12#include "ns3/config.h"
13#include "ns3/constant-position-mobility-model.h"
14#include "ns3/constant-velocity-mobility-model.h"
15#include "ns3/double.h"
17#include "ns3/mobility-building-info.h"
18#include "ns3/mobility-helper.h"
19#include "ns3/simulator.h"
21#include "ns3/three-gpp-propagation-loss-model.h"
61 void DoRun()
override;
83 :
TestCase(
"Test case for BuildingsPenetrationLosses"),
104 testVector.
m_pt = 0.0;
105 testVector.
m_pr = -77.3784;
112 testVector.
m_pt = 0.0;
113 testVector.
m_pr = -87.2965;
120 testVector.
m_pt = 0.0;
121 testVector.
m_pr = -108.5577;
129 testVector.
m_pt = 0.0;
130 testVector.
m_pr = -72.9380;
137 testVector.
m_pt = 0.0;
138 testVector.
m_pr = -86.2362;
145 testVector.
m_pt = 0.0;
146 testVector.
m_pr = -109.7252;
154 testVector.
m_pt = 0.0;
155 testVector.
m_pr = -69.8591;
162 testVector.
m_pt = 0.0;
163 testVector.
m_pr = -88.4122;
170 testVector.
m_pt = 0.0;
171 testVector.
m_pr = -119.3114;
178 building->SetExtWallsType(Building::ExtWallsType_t::ConcreteWithWindows);
179 building->SetNRoomsX(1);
180 building->SetNRoomsY(1);
181 building->SetNFloors(2);
182 building->SetBoundaries(
Box(0.0, 100.0, 0.0, 10.0, 0.0, 5.0));
198 a->AggregateObject(buildingInfoA);
199 buildingInfoA->MakeConsistent(a);
201 b->AggregateObject(buildingInfoB);
202 buildingInfoB->MakeConsistent(b);
220 bool isAIndoor = buildingInfoA->IsIndoor();
221 bool isBIndoor = buildingInfoB->IsIndoor();
223 if (!isAIndoor && !isBIndoor)
225 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
226 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2O);
232 "rcv power is not equal expected value");
236 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
237 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2I);
238 cond->SetO2iLowHighCondition(ChannelCondition::O2iLowHighConditionValue::LOW);
243 "rcv power is not less than calculated value");
static BuildingsPenetrationLossesTestSuite g_buildingsPenetrationLossesTestSuite
Static variable for test initialization.
Test case for the 3GPP channel O2I building penetration losses.
double m_tolerance
tolerance
TestVectors< TestVector > m_testVectors
array containing all the test vectors
Ptr< ThreeGppPropagationLossModel > m_propModel
the propagation loss model
void DoRun() override
Builds the simulation scenario and perform the tests.
~BuildingsPenetrationLossesTestCase() override
Destructor.
BuildingsPenetrationLossesTestCase()
Constructor.
Test suite for the buildings penetration losses.
BuildingsPenetrationLossesTestSuite()
This class can be used to hold variables of floating point type such as 'double' or 'float'.
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
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.
A simple way to store test vectors (for stimulus or from responses)
Base class for the 3GPP propagation models.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report if not.
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct containing the parameters for each test.
Vector m_positionB
the position of the second node
double m_pr
received power in dBm
TypeId m_propModel
the type ID of the propagation loss model to be used
TypeId m_condModel
the type ID of the channel condition model to be used
double m_frequency
carrier frequency in Hz
Vector m_positionA
the position of the first node
double m_pt
transmitted power in dBm