21 #include "../model/satellite-antenna-gain-pattern-container.h"
22 #include "../model/satellite-antenna-gain-pattern.h"
23 #include "../model/satellite-constant-position-mobility-model.h"
24 #include "../utils/satellite-env-variables.h"
27 #include "ns3/simulator.h"
28 #include "ns3/singleton.h"
49 virtual void DoRun(
void);
53 : TestCase(
"Test satellite antenna gain pattern.")
65 Singleton<SatEnvVariables>::Get()->DoInitialize();
66 Singleton<SatEnvVariables>::Get()->SetOutputVariables(
"test-antenna-gain-pattern",
"",
true);
68 std::cout <<
"SatEnvVariables::GetCurrentWorkingDirectory()"
69 << Singleton<SatEnvVariables>::Get()->GetCurrentWorkingDirectory() << std::endl;
74 Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
75 "/scenarios/geo-33E/antennapatterns");
78 Ptr<SatMobilityModel> mobility = CreateObject<SatConstantPositionMobilityModel>();
79 mobility->SetGeoPosition(geoPos);
83 std::vector<GeoCoordinate> coordinates;
85 coordinates.push_back(g1);
87 coordinates.push_back(g2);
89 coordinates.push_back(g3);
91 coordinates.push_back(g4);
93 coordinates.push_back(g5);
104 double expectedGains[5] = {51.5528, 51.4735, 51.3403, 51.6553, 51.4738};
107 uint32_t expectedBeamIds[5] = {12, 6, 22, 39, 58};
111 uint32_t bestBeamId(0);
112 for (uint32_t i = 0; i < coordinates.size(); ++i)
114 bestBeamId = gpContainer.
GetBestBeamId(0, coordinates[i],
false);
118 gain = gainPattern->GetAntennaGain_lin(coordinates[i], mobility);
119 double gain_dB = 10.0 * log10(gain);
129 NS_TEST_ASSERT_MSG_EQ_TOL(gain_dB,
132 "Expected gain not within tolerance");
133 NS_TEST_ASSERT_MSG_EQ(bestBeamId, expectedBeamIds[i],
"Not expected best spot-beam id");
136 Singleton<SatEnvVariables>::Get()->DoDispose();
150 : TestSuite(
"sat-antenna-gain-pattern-test", Type::UNIT)
virtual ~SatAntennaPatternTestCase()
SatAntennaPatternTestCase()
Satellite antenna pattern test suite.
SatAntennaPatternTestSuite()
GeoCoordinate class is used to store and operate with geodetic coordinates.
Antenna gain pattern container holds all antenna patterns related to a satellite system.
Ptr< SatAntennaGainPattern > GetAntennaGainPattern(uint32_t beamId) const
Get the antenna pattern of a specified beam id.
uint32_t GetBestBeamId(uint32_t satelliteId, GeoCoordinate coord, bool ignoreNan)
Get the best beam id based on the antenna patterns in a specified geo coordinate.
void ConfigureBeamsMobility(uint32_t satelliteId, Ptr< SatMobilityModel > mobility)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatAntennaPatternTestSuite satSatInterferenceTestSuite