28 #include <ns3/satellite-env-variables.h>
29 #include <ns3/satellite-free-space-loss.h>
30 #include <ns3/satellite-helper.h>
31 #include <ns3/satellite-mobility-model.h>
32 #include <ns3/satellite-topology.h>
33 #include <ns3/simulator.h>
34 #include <ns3/singleton.h>
62 virtual void DoRun(
void);
66 : TestCase(
"Test satellite free space loss model.")
78 Singleton<SatEnvVariables>::Get()->DoInitialize();
79 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-sat-fsl",
"",
true);
82 double frequency = 17.9 * std::pow(10.0, 9);
87 Ptr<SatHelper> helper = CreateObject<SatHelper>(
88 Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
"/scenarios/geo-33E");
90 helper->CreatePredefinedScenario(SatHelper::SIMPLE);
92 NodeContainer gw = Singleton<SatTopology>::Get()->GetGwNodes();
93 NodeContainer ut = Singleton<SatTopology>::Get()->GetUtNodes();
94 Ptr<Node> sat = Singleton<SatTopology>::Get()->GetOrbiterNode(0);
104 satMob->SetGeoPosition(
GeoCoordinate(0.0, 33.0, 35786000.0));
108 double fsl_dB = fsl.
GetFsldB(utMob, satMob, frequency);
115 NS_TEST_ASSERT_MSG_EQ_TOL(fsl_dB, 209.460211515483, 0.1,
"FSL (UT-GEO) in dBs incorrect");
119 fsl_dB = fsl.
GetFsldB(gwMob, satMob, frequency);
126 NS_TEST_ASSERT_MSG_EQ_TOL(fsl_dB, 208.86016171367487, 0.1,
"FSL (GW-GEO) in dBs incorrect");
128 Simulator::Destroy();
130 Singleton<SatEnvVariables>::Get()->DoDispose();
143 : TestSuite(
"sat-fsl-test", Type::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