9#include "ns3/boolean.h"
10#include "ns3/channel-condition-model.h"
11#include "ns3/config.h"
12#include "ns3/constant-position-mobility-model.h"
13#include "ns3/constant-velocity-mobility-model.h"
14#include "ns3/double.h"
16#include "ns3/mobility-helper.h"
17#include "ns3/simulator.h"
19#include "ns3/three-gpp-propagation-loss-model.h"
20#include "ns3/three-gpp-v2v-propagation-loss-model.h"
50 void DoRun()
override;
69 :
TestCase(
"Test for the ThreeGppRmaPropagationLossModel class"),
157 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
161 Vector
posBs = Vector(0.0, 0.0, 35.0);
175 b->SetPosition(
posUt);
181 "Got unexpected rcv power");
211 void DoRun()
override;
230 :
TestCase(
"Test for the ThreeGppUmaPropagationLossModel class"),
318 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
324 Vector
posBs = Vector(0.0, 0.0, 25.0);
338 b->SetPosition(
posUt);
344 "Got unexpected rcv power");
374 void DoRun()
override;
393 :
TestCase(
"Test for the ThreeGppUmiPropagationLossModel class"),
475 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
481 Vector
posBs = Vector(0.0, 0.0, 10.0);
495 b->SetPosition(
posUt);
501 "Got unexpected rcv power");
531 void DoRun()
override;
550 :
TestCase(
"Test for the ThreeGppIndoorOfficePropagationLossModel class"),
639 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
645 Vector
posBs = Vector(0.0, 0.0, 3.0);
659 b->SetPosition(
posUt);
665 "Got unexpected rcv power");
705 void DoRun()
override;
724 :
TestCase(
"Test for the ThreeGppV2vUrbanPropagationLossModel class."),
798 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
804 Vector
posUe1 = Vector(0.0, 0.0, 1.6);
824 "Got unexpected rcv power");
864 void DoRun()
override;
883 :
TestCase(
"Test for the ThreeGppV2vHighwayPropagationLossModel"),
957 lossModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
963 Vector
posUe1 = Vector(0.0, 0.0, 1.6);
983 "Got unexpected rcv power");
1001 void DoRun()
override;
1051 std::map<uint16_t , std::vector<double> >
1056 :
TestCase(
"Test to check if the shadow fading is correctly computed")
1094 a->SetPosition(Vector(0.0, 0.0,
hBs));
1099 b->SetPosition(Vector(0.0, distance,
hUt));
1100 b->SetVelocity(Vector(1.0, 0.0, 0.0));
1121 for (
int i = 0;
i < 200;
i++)
1174 testVector.m_propagationLossModelType =
"ns3::ThreeGppRmaPropagationLossModel";
1182 testVector.m_propagationLossModelType =
"ns3::ThreeGppUmaPropagationLossModel";
1190 testVector.m_propagationLossModelType =
"ns3::ThreeGppUmiStreetCanyonPropagationLossModel";
1198 testVector.m_propagationLossModelType =
"ns3::ThreeGppIndoorOfficePropagationLossModel";
1206 testVector.m_propagationLossModelType =
"ns3::ThreeGppV2vUrbanPropagationLossModel";
1214 testVector.m_propagationLossModelType =
"ns3::ThreeGppV2vHighwayPropagationLossModel";
1232 tv.m_propagationLossModelType,
1258 tv.m_propagationLossModelType,
1276 "Null hypothesis test (LOS case) for the shadowing component rejected");
1284 (
tv.m_shadowingStdNlos / std::sqrt(
mean_vector.size() / 2));
1289 "Null hypothesis test (NLOS case) for the shadowing component rejected");
Test case for the class ThreeGppIndoorOfficePropagationLossModel.
ThreeGppIndoorOfficePropagationLossModelTestCase()
Constructor.
void DoRun() override
Build the simulation scenario and run the tests.
double m_tolerance
tolerance
TestVectors< TestVector > m_testVectors
array containing all the test vectors
~ThreeGppIndoorOfficePropagationLossModelTestCase() override
Destructor.
3GPP Propagation models TestSuite
ThreeGppPropagationLossModelsTestSuite()
Test case for the class ThreeGppRmaPropagationLossModel.
ThreeGppRmaPropagationLossModelTestCase()
Constructor.
void DoRun() override
Build the simulation scenario and run the tests.
~ThreeGppRmaPropagationLossModelTestCase() override
Destructor.
double m_tolerance
tolerance
TestVectors< TestVector > m_testVectors
array containing all the test vectors
Test to check if the shadowing fading is correctly computed.
void EvaluateLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, uint8_t testNum)
Compute the propagation loss.
~ThreeGppShadowingTestCase() override
ThreeGppShadowingTestCase()
void DoRun() override
Implementation to actually run this TestCase.
std::map< uint16_t, std::vector< double > > m_results
used to store the test results
void ChangeChannelCondition(Ptr< ChannelConditionModel > ccm)
Change the channel condition model.
Ptr< ThreeGppPropagationLossModel > m_lossModel
the propagation loss model
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void RunTest(uint16_t testNum, std::string propagationLossModelType, double hBs, double hUt, double distance, bool shadowingEnabled)
Run the experiment.
Test case for the class ThreeGppUmaPropagationLossModel.
double m_tolerance
tolerance
~ThreeGppUmaPropagationLossModelTestCase() override
Destructor.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
void DoRun() override
Build the simulation scenario and run the tests.
ThreeGppUmaPropagationLossModelTestCase()
Constructor.
Test case for the class ThreeGppUmiStreetCanyonPropagationLossModel.
ThreeGppUmiPropagationLossModelTestCase()
Constructor.
~ThreeGppUmiPropagationLossModelTestCase() override
Destructor.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
double m_tolerance
tolerance
void DoRun() override
Build the simulation scenario and run the tests.
Test case for the class ThreeGppV2vHighwayPropagationLossModel.
ThreeGppV2vHighwayPropagationLossModelTestCase()
Constructor.
~ThreeGppV2vHighwayPropagationLossModelTestCase() override
Destructor.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
double m_tolerance
tolerance
void DoRun() override
Build the simulation scenario and run the tests.
Test case for the class ThreeGppV2vUrbanPropagationLossModel.
ThreeGppV2vUrbanPropagationLossModelTestCase()
Constructor.
~ThreeGppV2vUrbanPropagationLossModelTestCase() override
Destructor.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
double m_tolerance
tolerance
void DoRun() override
Build the simulation scenario and run the tests.
AttributeValue implementation for Boolean.
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.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
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.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
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_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct containing the parameters for each test.
double m_frequency
carrier frequency in Hz
double m_pt
transmitted power in dBm
double m_pr
received power in dBm
bool m_isLos
if true LOS, if false NLOS
double m_distance
2D distance between UT and BS in meters
Struct containing the parameters for each test.
double m_pr
received power in dBm
double m_pt
transmitted power in dBm
bool m_isLos
if true LOS, if false NLOS
double m_distance
2D distance between UT and BS in meters
double m_frequency
carrier frequency in Hz
Struct containing the parameters for each test.
double m_distance
the initial 2D distance in meters between BS and UT in meters
double m_hBs
the BS height in meters
double m_hUt
the UT height in meters
std::string m_propagationLossModelType
the propagation loss model type id
double m_shadowingStdLos
the standard deviation of the shadowing component in the LOS case in dB
double m_shadowingStdNlos
the standard deviation of the shadowing component in the NLOS case in dB
Struct containing the parameters for each test.
double m_pt
transmitted power in dBm
bool m_isLos
if true LOS, if false NLOS
double m_pr
received power in dBm
double m_frequency
carrier frequency in Hz
double m_distance
2D distance between UT and BS in meters
Struct containing the parameters for each test.
double m_frequency
carrier frequency in Hz
bool m_isLos
if true LOS, if false NLOS
double m_pr
received power in dBm
double m_distance
2D distance between UT and BS in meters
double m_pt
transmitted power in dBm
Struct containing the parameters for each test.
double m_distance
2D distance between UT and BS in meters
double m_pr
received power in dBm
double m_pt
transmitted power in dBm
double m_frequency
carrier frequency in Hz
bool m_isLos
if true LOS/NLOSv, if false NLOS
Struct containing the parameters for each test.
double m_frequency
carrier frequency in Hz
bool m_isLos
if true LOS/NLOSv, if false NLOS
double m_distance
2D distance between UT and BS in meters
double m_pt
transmitted power in dBm
double m_pr
received power in dBm
static ThreeGppPropagationLossModelsTestSuite g_propagationLossModelsTestSuite
Static variable for test initialization.