27 #include "../helper/satellite-helper.h"
28 #include "../model/satellite-free-space-loss.h"
29 #include "../model/satellite-mobility-model.h"
30 #include "../utils/satellite-env-variables.h"
33 #include "ns3/simulator.h"
34 #include "ns3/singleton.h"
60 virtual void DoRun(
void);
64 : TestCase(
"Test satellite free space loss model.")
76 Singleton<SatEnvVariables>::Get()->DoInitialize();
77 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-fsl",
"",
true);
80 double frequency = 17.9 * std::pow(10.0, 9);
85 Ptr<SatHelper> helper = CreateObject<SatHelper>();
87 helper->CreatePredefinedScenario(SatHelper::SIMPLE);
89 NodeContainer gw = helper->GwNodes();
90 NodeContainer ut = helper->UtNodes();
91 Ptr<Node> geo = helper->GeoSatNodes().Get(0);
101 geoMob->SetGeoPosition(
GeoCoordinate(0.0, 33.0, 35786000.0));
105 double fsl_dB = fsl.
GetFsldB(utMob, geoMob, frequency);
112 NS_TEST_ASSERT_MSG_EQ_TOL(fsl_dB, 209.460211515483, 0.1,
"FSL (UT-GEO) in dBs incorrect");
116 fsl_dB = fsl.
GetFsldB(gwMob, geoMob, frequency);
123 NS_TEST_ASSERT_MSG_EQ_TOL(fsl_dB, 208.86016171367487, 0.1,
"FSL (GW-GEO) in dBs incorrect");
125 Simulator::Destroy();
127 Singleton<SatEnvVariables>::Get()->DoDispose();
140 : TestSuite(
"sat-fsl-test", UNIT)
Test case to unit test satellite free space loss (FSL) model.
SatFreeSpaceLossTestCase()
virtual ~SatFreeSpaceLossTestCase()
Test suite for Satellite free space loss unit test cases.
SatFreeSpaceLossTestSuite()
GeoCoordinate class is used to store and operate with geodetic coordinates.
This class is responsible of calculating the free space loss (FSL) based on two given node positions ...
virtual double GetFsldB(Ptr< MobilityModel > a, Ptr< MobilityModel > b, double frequencyHz) const
Calculate the free-space loss in dB.
Keep track of the current position and velocity of an object in satellite network.
void SetGeoPosition(const GeoCoordinate &position)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatFreeSpaceLossTestSuite satFslTestSuite