20#include "ns3/boolean.h"
21#include "ns3/channel-condition-model.h"
22#include "ns3/config.h"
23#include "ns3/constant-position-mobility-model.h"
24#include "ns3/constant-velocity-mobility-model.h"
25#include "ns3/double.h"
26#include "ns3/geocentric-constant-position-mobility-model.h"
28#include "ns3/mobility-helper.h"
29#include "ns3/simulator.h"
31#include "ns3/three-gpp-propagation-loss-model.h"
32#include "ns3/three-gpp-v2v-propagation-loss-model.h"
88 void DoRun()
override;
101 :
TestCase(
"Creating ThreeGppNTNPropagationLossModelTestCase")
111 CreateObject<ThreeGppNTNDenseUrbanPropagationLossModel>();
112 denseUrbanModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
114 CreateObject<ThreeGppNTNUrbanPropagationLossModel>();
115 urbanModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
117 CreateObject<ThreeGppNTNSuburbanPropagationLossModel>();
118 suburbanModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
120 CreateObject<ThreeGppNTNRuralPropagationLossModel>();
121 ruralModel->SetAttribute(
"ShadowingEnabled",
BooleanValue(
false));
124 std::vector<TestPoint> testPoints = {
128 {35786000,
true, 20.0e9, -209.915, denseUrbanModel},
129 {35786000,
true, 30.0e9, -213.437, denseUrbanModel},
130 {35786000,
true, 2.0e9, -191.744, denseUrbanModel},
131 {600000,
true, 20.0e9, -174.404, denseUrbanModel},
132 {600000,
true, 30.0e9, -177.925, denseUrbanModel},
133 {600000,
true, 2.0e9, -156.233, denseUrbanModel},
134 {1200000,
true, 20.0e9, -180.424, denseUrbanModel},
135 {1200000,
true, 30.0e9, -183.946, denseUrbanModel},
136 {1200000,
true, 2.0e9, -162.253, denseUrbanModel},
138 {35786000,
true, 20.0e9, -209.915, urbanModel},
139 {35786000,
true, 30.0e9, -213.437, urbanModel},
140 {35786000,
true, 2.0e9, -191.744, urbanModel},
141 {600000,
true, 20.0e9, -174.404, urbanModel},
142 {600000,
true, 30.0e9, -177.925, urbanModel},
143 {600000,
true, 2.0e9, -156.233, urbanModel},
144 {1200000,
true, 20.0e9, -180.424, urbanModel},
145 {1200000,
true, 30.0e9, -183.946, urbanModel},
146 {1200000,
true, 2.0e9, -162.253, urbanModel},
148 {35786000,
true, 20.0e9, -209.915, suburbanModel},
149 {35786000,
true, 30.0e9, -213.437, suburbanModel},
150 {35786000,
true, 2.0e9, -191.744, suburbanModel},
151 {600000,
true, 20.0e9, -174.404, suburbanModel},
152 {600000,
true, 30.0e9, -177.925, suburbanModel},
153 {600000,
true, 2.0e9, -156.233, suburbanModel},
154 {1200000,
true, 20.0e9, -180.424, suburbanModel},
155 {1200000,
true, 30.0e9, -183.946, suburbanModel},
156 {1200000,
true, 2.0e9, -162.253, suburbanModel},
158 {35786000,
true, 20.0e9, -209.915, ruralModel},
159 {35786000,
true, 30.0e9, -213.437, ruralModel},
160 {35786000,
true, 2.0e9, -191.744, ruralModel},
161 {600000,
true, 20.0e9, -174.404, ruralModel},
162 {600000,
true, 30.0e9, -177.925, ruralModel},
163 {600000,
true, 2.0e9, -156.233, ruralModel},
164 {1200000,
true, 20.0e9, -180.424, ruralModel},
165 {1200000,
true, 30.0e9, -183.946, ruralModel},
166 {1200000,
true, 2.0e9, -162.253, ruralModel}};
169 for (
auto& point : testPoints)
189 Vector posA = Vector(0.0, 0.0, 0.0);
190 a->SetPosition(posA);
191 Vector posB = Vector(0.0, 0.0, testPoint.
m_distance);
192 b->SetPosition(posB);
200 conditionModel = CreateObject<AlwaysLosChannelConditionModel>();
204 conditionModel = CreateObject<NeverLosChannelConditionModel>();
212 "Obtained unexpected received power");
235 :
TestSuite(
"three-gpp-ntn-propagation-loss-model",
Type::UNIT)
Test case for the ThreeGppNTNPropagationLossModel classes.
ThreeGppNTNPropagationLossModelTestCase()
void DoRun() override
Build the simulation scenario and run the tests.
void TestChannelGain(TestPoint testPoint)
Test the channel gain for a specific parameter configuration, by comparing the antenna gain obtained ...
3GPP NTN Propagation models TestSuite
ThreeGppNTNPropagationLossModelsTestSuite()
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.
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.
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#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.
Description of a single test point.
TestPoint(double distance, bool isLos, double frequency, double pwrRxDbm, Ptr< ThreeGppPropagationLossModel > lossModel)
Constructor.
double m_pwrRxDbm
received power in dBm
bool m_isLos
if true LOS, if false NLOS
Ptr< ThreeGppPropagationLossModel > m_propagationLossModel
the path loss model to test
double m_distance
2D distance between test nodes, in meters
double m_frequency
carrier frequency in Hz
static ThreeGppNTNPropagationLossModelsTestSuite g_propagationLossModelsTestSuite
Static variable for test initialization.