18 #include "ns3/abort.h"
19 #include "ns3/boolean.h"
20 #include "ns3/building.h"
21 #include "ns3/buildings-channel-condition-model.h"
22 #include "ns3/channel-condition-model.h"
23 #include "ns3/config.h"
24 #include "ns3/constant-position-mobility-model.h"
25 #include "ns3/constant-velocity-mobility-model.h"
26 #include "ns3/double.h"
28 #include "ns3/mobility-building-info.h"
29 #include "ns3/mobility-helper.h"
30 #include "ns3/simulator.h"
32 #include "ns3/three-gpp-propagation-loss-model.h"
72 void DoRun()
override;
95 :
TestCase(
"Test case for BuildingsPenetrationLosses"),
115 testVector.
m_propModel = ThreeGppRmaPropagationLossModel::GetTypeId();
116 testVector.
m_pt = 0.0;
117 testVector.
m_pr = -77.3784;
123 testVector.
m_propModel = ThreeGppRmaPropagationLossModel::GetTypeId();
124 testVector.
m_pt = 0.0;
125 testVector.
m_pr = -87.2965;
131 testVector.
m_propModel = ThreeGppRmaPropagationLossModel::GetTypeId();
132 testVector.
m_pt = 0.0;
133 testVector.
m_pr = -108.5577;
140 testVector.
m_propModel = ThreeGppUmaPropagationLossModel::GetTypeId();
141 testVector.
m_pt = 0.0;
142 testVector.
m_pr = -72.9380;
148 testVector.
m_propModel = ThreeGppUmaPropagationLossModel::GetTypeId();
149 testVector.
m_pt = 0.0;
150 testVector.
m_pr = -86.2362;
156 testVector.
m_propModel = ThreeGppUmaPropagationLossModel::GetTypeId();
157 testVector.
m_pt = 0.0;
158 testVector.
m_pr = -109.7252;
165 testVector.
m_propModel = ThreeGppUmiStreetCanyonPropagationLossModel::GetTypeId();
166 testVector.
m_pt = 0.0;
167 testVector.
m_pr = -69.8591;
173 testVector.
m_propModel = ThreeGppUmiStreetCanyonPropagationLossModel::GetTypeId();
174 testVector.
m_pt = 0.0;
175 testVector.
m_pr = -88.4122;
181 testVector.
m_propModel = ThreeGppUmiStreetCanyonPropagationLossModel::GetTypeId();
182 testVector.
m_pt = 0.0;
183 testVector.
m_pr = -119.3114;
190 building->SetExtWallsType(Building::ExtWallsType_t::ConcreteWithWindows);
191 building->SetNRoomsX(1);
192 building->SetNRoomsY(1);
193 building->SetNFloors(2);
194 building->SetBoundaries(
Box(0.0, 100.0, 0.0, 10.0, 0.0, 5.0));
211 buildingInfoA->MakeConsistent(a);
214 buildingInfoB->MakeConsistent(b);
232 bool isAIndoor = buildingInfoA->IsIndoor();
233 bool isBIndoor = buildingInfoB->IsIndoor();
235 if (!isAIndoor && !isBIndoor)
237 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
238 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2O);
244 "rcv power is not equal expected value");
248 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
249 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2I);
255 "rcv power is not less than calculated value");
259 Simulator::Destroy();
274 :
TestSuite(
"buildings-penetration-losses", UNIT)
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'.
void SetPosition(const Vector &position)
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.
double CalcRxPower(double txPowerDbm, Ptr< MobilityModel > a, Ptr< MobilityModel > b) const
Returns the Rx Power taking into account all the PropagationLossModel(s) chained to the current one.
void AddTestCase(TestCase *testCase, TestDuration 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.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition)
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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
bool m_isLos
LOS probability.
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