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;
94 :
TestCase(
"Test case for BuildingsPenetrationLosses"),
115 testVector.
m_pt = 0.0;
116 testVector.
m_pr = -77.3784;
123 testVector.
m_pt = 0.0;
124 testVector.
m_pr = -87.2965;
131 testVector.
m_pt = 0.0;
132 testVector.
m_pr = -108.5577;
140 testVector.
m_pt = 0.0;
141 testVector.
m_pr = -72.9380;
148 testVector.
m_pt = 0.0;
149 testVector.
m_pr = -86.2362;
156 testVector.
m_pt = 0.0;
157 testVector.
m_pr = -109.7252;
165 testVector.
m_pt = 0.0;
166 testVector.
m_pr = -69.8591;
173 testVector.
m_pt = 0.0;
174 testVector.
m_pr = -88.4122;
181 testVector.
m_pt = 0.0;
182 testVector.
m_pr = -119.3114;
189 building->SetExtWallsType(Building::ExtWallsType_t::ConcreteWithWindows);
190 building->SetNRoomsX(1);
191 building->SetNRoomsY(1);
192 building->SetNFloors(2);
193 building->SetBoundaries(
Box(0.0, 100.0, 0.0, 10.0, 0.0, 5.0));
209 a->AggregateObject(buildingInfoA);
210 buildingInfoA->MakeConsistent(a);
212 b->AggregateObject(buildingInfoB);
213 buildingInfoB->MakeConsistent(b);
231 bool isAIndoor = buildingInfoA->IsIndoor();
232 bool isBIndoor = buildingInfoB->IsIndoor();
234 if (!isAIndoor && !isBIndoor)
236 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
237 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2O);
243 "rcv power is not equal expected value");
247 cond->SetLosCondition(ChannelCondition::LosConditionValue::LOS);
248 cond->SetO2iCondition(ChannelCondition::O2iConditionValue::O2I);
249 cond->SetO2iLowHighCondition(ChannelCondition::O2iLowHighConditionValue::LOW);
254 "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.
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.
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.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition)
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.
#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