21 #include "ns3/abort.h" 23 #include "ns3/config.h" 24 #include "ns3/double.h" 25 #include "ns3/boolean.h" 26 #include "ns3/channel-condition-model.h" 27 #include "ns3/three-gpp-propagation-loss-model.h" 28 #include "ns3/constant-position-mobility-model.h" 29 #include "ns3/constant-velocity-mobility-model.h" 30 #include "ns3/mobility-helper.h" 31 #include "ns3/simulator.h" 59 virtual void DoRun (
void);
78 :
TestCase (
"Test for the ThreeGppRmaPropagationLossModel class"),
96 testVector.
m_pt = 0.0;
97 testVector.
m_pr = -77.3784;
103 testVector.
m_pt = 0.0;
104 testVector.
m_pr = -87.2965;
110 testVector.
m_pt = 0.0;
111 testVector.
m_pr = -108.5577;
117 testVector.
m_pt = 0.0;
118 testVector.
m_pr = -140.3896;
124 testVector.
m_pt = 0.0;
125 testVector.
m_pr = -77.3784;
131 testVector.
m_pt = 0.0;
132 testVector.
m_pr = -95.7718;
138 testVector.
m_pt = 0.0;
139 testVector.
m_pr = -133.5223;
145 testVector.
m_pt = 0.0;
146 testVector.
m_pr = -160.5169;
155 nodes.Get (0)->AggregateObject (a);
157 nodes.Get (1)->AggregateObject (b);
165 lossModel->SetAttribute (
"ShadowingEnabled",
BooleanValue (
false));
171 Vector posBs = Vector (0.0, 0.0, 35.0);
172 Vector posUt = Vector (testVector.
m_distance, 0.0, 1.5);
177 lossModel->SetChannelConditionModel (losCondModel);
181 lossModel->SetChannelConditionModel (nlosCondModel);
191 Simulator::Destroy ();
216 virtual void DoRun (
void);
235 :
TestCase (
"Test for the ThreeGppUmaPropagationLossModel class"),
253 testVector.
m_pt = 0.0;
254 testVector.
m_pr = -72.9380;
260 testVector.
m_pt = 0.0;
261 testVector.
m_pr = -86.2362;
267 testVector.
m_pt = 0.0;
268 testVector.
m_pr = -109.7252;
274 testVector.
m_pt = 0.0;
275 testVector.
m_pr = -137.6794;
281 testVector.
m_pt = 0.0;
282 testVector.
m_pr = -82.5131;
288 testVector.
m_pt = 0.0;
289 testVector.
m_pr = -106.1356;
295 testVector.
m_pt = 0.0;
296 testVector.
m_pr = -144.7641;
302 testVector.
m_pt = 0.0;
303 testVector.
m_pr = -172.0753;
312 nodes.Get (0)->AggregateObject (a);
314 nodes.Get (1)->AggregateObject (b);
322 lossModel->SetAttribute (
"ShadowingEnabled",
BooleanValue (
false));
328 Vector posBs = Vector (0.0, 0.0, 25.0);
329 Vector posUt = Vector (testVector.
m_distance, 0.0, 1.5);
334 lossModel->SetChannelConditionModel (losCondModel);
338 lossModel->SetChannelConditionModel (nlosCondModel);
348 Simulator::Destroy ();
373 virtual void DoRun (
void);
392 :
TestCase (
"Test for the ThreeGppUmiPropagationLossModel class"),
410 testVector.
m_pt = 0.0;
411 testVector.
m_pr = -69.8591;
417 testVector.
m_pt = 0.0;
418 testVector.
m_pr = -88.4122;
424 testVector.
m_pt = 0.0;
425 testVector.
m_pr = -119.3114;
430 testVector.
m_pt = 0.0;
431 testVector.
m_pr = -147.2696;
436 testVector.
m_pt = 0.0;
437 testVector.
m_pr = -76.7563;
442 testVector.
m_pt = 0.0;
443 testVector.
m_pr = -107.9432;
448 testVector.
m_pt = 0.0;
449 testVector.
m_pr = -143.1886;
454 testVector.
m_pt = 0.0;
455 testVector.
m_pr = -167.8617;
463 nodes.Get (0)->AggregateObject (a);
465 nodes.Get (1)->AggregateObject (b);
473 lossModel->SetAttribute (
"ShadowingEnabled",
BooleanValue (
false));
479 Vector posBs = Vector (0.0, 0.0, 10.0);
480 Vector posUt = Vector (testVector.
m_distance, 0.0, 1.5);
485 lossModel->SetChannelConditionModel (losCondModel);
489 lossModel->SetChannelConditionModel (nlosCondModel);
499 Simulator::Destroy ();
524 virtual void DoRun (
void);
543 :
TestCase (
"Test for the ThreeGppIndoorOfficePropagationLossModel class"),
561 testVector.
m_pt = 0.0;
562 testVector.
m_pr = -50.8072;
568 testVector.
m_pt = 0.0;
569 testVector.
m_pr = -63.7630;
575 testVector.
m_pt = 0.0;
576 testVector.
m_pr = -75.7750;
582 testVector.
m_pt = 0.0;
583 testVector.
m_pr = -80.9802;
589 testVector.
m_pt = 0.0;
590 testVector.
m_pr = -50.8072;
596 testVector.
m_pt = 0.0;
597 testVector.
m_pr = -73.1894;
603 testVector.
m_pt = 0.0;
604 testVector.
m_pr = -99.7824;
610 testVector.
m_pt = 0.0;
611 testVector.
m_pr = -111.3062;
620 nodes.Get (0)->AggregateObject (a);
622 nodes.Get (1)->AggregateObject (b);
630 lossModel->SetAttribute (
"ShadowingEnabled",
BooleanValue (
false));
636 Vector posBs = Vector (0.0, 0.0, 3.0);
637 Vector posUt = Vector (testVector.
m_distance, 0.0, 1.5);
642 lossModel->SetChannelConditionModel (losCondModel);
646 lossModel->SetChannelConditionModel (nlosCondModel);
656 Simulator::Destroy ();
667 virtual void DoRun (
void);
678 void RunTest (uint16_t testNum, std::string propagationLossModelType,
double hBs,
double hUt,
double distance,
bool shadowingEnabled);
710 :
TestCase (
"Test to check if the shadow fading is correctly computed")
735 m_results [testNum] = std::vector<double> ();
744 nodes.Get (0)->AggregateObject (a);
747 nodes.Get (1)->AggregateObject (b);
766 for (
int i = 0; i < 200; i++)
775 Simulator::Destroy ();
798 testVector.
m_hBs = 25;
799 testVector.
m_hUt = 1.6;
806 testVector.
m_hBs = 25;
807 testVector.
m_hUt = 1.6;
814 testVector.
m_hBs = 25;
815 testVector.
m_hUt = 1.6;
822 testVector.
m_hBs = 10;
823 testVector.
m_hUt = 1.6;
830 testVector.
m_hBs = 3;
831 testVector.
m_hUt = 1;
837 uint16_t numSamples = 250;
839 for (uint16_t tvIndex = 0; tvIndex <
m_testVectors.GetN (); tvIndex++)
844 for (uint16_t sampleIndex = 0; sampleIndex < numSamples; sampleIndex++)
850 std::vector<double> mean_vector;
852 uint16_t numPositions =
m_results.at (0).size ();
853 for (uint16_t k = 0; k < numPositions; k++)
859 mean += resIt.second.at (k);
862 mean_vector.push_back (mean);
867 std::vector<double> true_mean =
m_results.at (numSamples);
871 for (uint16_t i = 0; i < mean_vector.size () / 2; i++)
873 double z = (mean_vector.at (i) - true_mean.at (i)) / (tv.
m_shadowingStdLos / std::sqrt (mean_vector.size () / 2));
879 for (uint16_t i = mean_vector.size () / 2; i < mean_vector.size (); i++)
881 double z = (mean_vector.at (i) - true_mean.at (i)) / (tv.
m_shadowingStdNlos / std::sqrt (mean_vector.size () / 2));
894 :
TestSuite (
"three-gpp-propagation-loss-model", UNIT)
ThreeGppUmiPropagationLossModelTestCase()
Constructor.
virtual void DoRun(void)
Build the simulation scenario and run the tests.
double m_pt
transmitted power in dBm
bool m_isLos
if true LOS, if false NLOS
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...
AttributeValue implementation for Boolean.
Test case for the class ThreeGppIndoorOfficePropagationLossModel.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
Test case for the class ThreeGppRmaPropagationLossModel.
Struct containing the parameters for each test.
double m_shadowingStdNlos
the standard deviation of the shadowing component in the NLOS case in dB
double m_distance
2D distance between UT and BS in meters
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
double m_pt
transmitted power in dBm
void ChangeChannelCondition(Ptr< ChannelConditionModel > ccm)
virtual void DoRun(void)
Build the simulation scenario and run the tests.
virtual ~ThreeGppUmiPropagationLossModelTestCase()
Destructor.
ThreeGppIndoorOfficePropagationLossModelTestCase()
Constructor.
Ptr< ThreeGppPropagationLossModel > m_lossModel
the propagation loss model
A simple way to store test vectors (for stimulus or from responses)
double m_distance
2D distance between UT and BS in meters
double m_frequency
carrier frequency in Hz
ThreeGppRmaPropagationLossModelTestCase()
Constructor.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
virtual ~ThreeGppUmaPropagationLossModelTestCase()
Destructor.
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.
double m_distance
2D distance between UT and BS in meters
virtual void DoRun(void)
Build the simulation scenario and run the tests.
ThreeGppUmaPropagationLossModelTestCase()
Constructor.
Struct containing the parameters for each test.
void EvaluateLoss(Ptr< MobilityModel > a, Ptr< MobilityModel > b, uint8_t testNum)
Compute the propagation loss.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
double m_pt
transmitted power in dBm
bool m_isLos
if true LOS, if false NLOS
virtual void DoRun(void)
Implementation to actually run this TestCase.
double m_pr
received power in dBm
double m_distance
the initial 2D distance in meters between BS and UT in meters
#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 ...
Struct containing the parameters for each test.
std::string m_propagationLossModelType
the propagation loss model type id
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Struct containing the parameters for each test.
ThreeGppShadowingTestCase()
virtual void DoRun(void)
Build the simulation scenario and run the tests.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
double m_hBs
the BS height in meters
Test case for the class ThreeGppUmiStreetCanyonPropagationLossModel.
double m_pr
received power in dBm
double m_tolerance
tolerance
bool m_isLos
if true LOS, if false NLOS
double m_tolerance
tolerance
double m_shadowingStdLos
the standard deviation of the shadowing component in the LOS case in dB
double m_frequency
carrier frequency in Hz
void SetPosition(const Vector &position)
double m_tolerance
tolerance
Instantiate subclasses of ns3::Object.
virtual ~ThreeGppRmaPropagationLossModelTestCase()
Destructor.
static ThreeGppPropagationLossModelsTestSuite propagationLossModelsTestSuite
std::map< uint16_t, std::vector< double > > m_results
used to store the test results
ThreeGppPropagationLossModelsTestSuite()
double m_frequency
carrier frequency in Hz
void SetChannelConditionModel(Ptr< ChannelConditionModel > model)
Set the channel condition model used to determine the channel state (e.g., the LOS/NLOS condition) ...
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual ~ThreeGppShadowingTestCase()
Test case for the class ThreeGppUmaPropagationLossModel.
Base class for the 3GPP propagation models.
virtual ~ThreeGppIndoorOfficePropagationLossModelTestCase()
Destructor.
double m_hUt
the UT height in meters
double m_distance
2D distance between UT and BS in meters
bool m_isLos
if true LOS, if false NLOS
double m_pr
received power in dBm
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Struct containing the parameters for each test.
double m_frequency
carrier frequency in Hz
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
void SetVelocity(const Vector &speed)
double m_pt
transmitted power in dBm
double m_pr
received power in dBm
double m_tolerance
tolerance