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);
72 Ptr<SatMobilityModel> mobility = CreateObject<SatConstantPositionMobilityModel>();
73 mobility->SetGeoPosition(geoPos);
77 std::vector<GeoCoordinate> coordinates;
79 coordinates.push_back(g1);
81 coordinates.push_back(g2);
83 coordinates.push_back(g3);
85 coordinates.push_back(g4);
87 coordinates.push_back(g5);
98 double expectedGains[5] = {51.5528, 51.4735, 51.3403, 51.6553, 51.4738};
101 uint32_t expectedBeamIds[5] = {12, 6, 22, 39, 58};
105 uint32_t bestBeamId(0);
106 for (uint32_t i = 0; i < coordinates.size(); ++i)
108 bestBeamId = gpContainer.
GetBestBeamId(0, coordinates[i],
false);
112 gain = gainPattern->GetAntennaGain_lin(coordinates[i], mobility);
113 double gain_dB = 10.0 * log10(gain);
123 NS_TEST_ASSERT_MSG_EQ_TOL(gain_dB,
126 "Expected gain not within tolerance");
127 NS_TEST_ASSERT_MSG_EQ(bestBeamId, expectedBeamIds[i],
"Not expected best spot-beam id");
130 Singleton<SatEnvVariables>::Get()->DoDispose();
144 : TestSuite(
"sat-antenna-gain-pattern-test", 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