ns3::SatAntennaGainPattern Class Reference

SatAntennaGainPattern class holds the antenna gain pattern data for a one single spot-beam. More...

#include "satellite-antenna-gain-pattern.h"

+ Inheritance diagram for ns3::SatAntennaGainPattern:
+ Collaboration diagram for ns3::SatAntennaGainPattern:

Public Member Functions

 SatAntennaGainPattern ()
 Default constructor. More...
 
 SatAntennaGainPattern (std::string filePathName, GeoCoordinate defaultSatellitePosition)
 Constructor with initialization parameters. More...
 
 ~SatAntennaGainPattern ()
 
double GetAntennaGain_lin (GeoCoordinate coord, Ptr< SatMobilityModel > mobility) const
 Calculate the antenna gain value for a certain {latitude, longitude} point. More...
 
virtual TypeId GetInstanceTypeId (void) const
 Get the type ID of instance. More...
 
void GetSatelliteOffset (double &latOffset, double &lonOffset, Ptr< SatMobilityModel > mobility) const
 
GeoCoordinate GetValidRandomPosition (Ptr< SatMobilityModel > mobility) const
 Get a valid random position under this spot-beam coverage. More...
 
bool IsValidPosition (GeoCoordinate coord, TracedCallback< double > cb, Ptr< SatMobilityModel > mobility) const
 Check if a given position is under this spot-beam coverage. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void ReadAntennaPatternFromFile (std::string filePathName)
 Read the antenna gain pattern from a file. More...
 

Private Attributes

std::vector< std::vector< double > > m_antennaPattern
 Container for the antenna pattern from one spot-beam. More...
 
double m_latDefaultSatellite
 Latitude of default satellite for antenna gain pattern. More...
 
double m_latInterval
 Interval between latitudes, must be constant. More...
 
std::vector< double > m_latitudes
 All valid latitudes from the file. More...
 
double m_lonDefaultSatellite
 Longitude of default satellite for antenna gain pattern. More...
 
std::vector< double > m_longitudes
 All valid latitudes from the file. More...
 
double m_lonInterval
 Interval between longitudes, must be constant. More...
 
double m_maxLat
 Maximum latitude value of the antenna gain pattern. More...
 
double m_maxLon
 Minimum longitude value of the antenna gain pattern. More...
 
double m_minAcceptableAntennaGainInDb
 Minimum acceptable antenna gain for a serving spot-beam. More...
 
double m_minLat
 Minimum latitude value of the antenna gain pattern. More...
 
double m_minLon
 Minimum longitude value of the antenna gain pattern. More...
 
std::vector< std::string > m_nanStrings
 
Ptr< UniformRandomVariable > m_uniformRandomVariable
 Uniform random variable used for beam selection. More...
 
std::vector< std::pair< double, double > > m_validPositions
 Container for valid positions. More...
 

Static Private Attributes

static const std::string m_nanStringArray [4] = {"nan", "NaN", "Nan", "NAN"}
 Valid Not-a-Number (NaN) strings. More...
 

Detailed Description

SatAntennaGainPattern class holds the antenna gain pattern data for a one single spot-beam.

In initialization phase, the gain pattern is read from a file to a container. Current implementation assumes that the antenna pattern is using a constant longitude-latitude grid of samples. This assumption is made to enable fast look-ups from the container (= vector<vector<double>>).

Antenna gain patter is used also for spot-beam selection. In initialization phase a valid positions list is constructed based on a minimum accepted antenna gain set as an attribute. This approach is selected to speed up the random UT positioning.

Antenna gain value for a given longitude and latitude position is calculated by using 4-point bilinear interpolation.

Definition at line 53 of file satellite-antenna-gain-pattern.h.

Constructor & Destructor Documentation

◆ SatAntennaGainPattern() [1/2]

ns3::SatAntennaGainPattern::SatAntennaGainPattern ( )

Default constructor.

Definition at line 62 of file satellite-antenna-gain-pattern.cc.

◆ SatAntennaGainPattern() [2/2]

ns3::SatAntennaGainPattern::SatAntennaGainPattern ( std::string  filePathName,
GeoCoordinate  defaultSatellitePosition 
)

Constructor with initialization parameters.

Parameters
filePathNamePath of file to read antenna gain patterns
defaultSatellitePositionPosition of satellite associated to this pattern

Definition at line 82 of file satellite-antenna-gain-pattern.cc.

References ns3::GeoCoordinate::GetLatitude(), ns3::GeoCoordinate::GetLongitude(), m_latDefaultSatellite, m_lonDefaultSatellite, m_uniformRandomVariable, and ReadAntennaPatternFromFile().

+ Here is the call graph for this function:

◆ ~SatAntennaGainPattern()

ns3::SatAntennaGainPattern::~SatAntennaGainPattern ( )
inline

Definition at line 80 of file satellite-antenna-gain-pattern.h.

Member Function Documentation

◆ GetAntennaGain_lin()

double ns3::SatAntennaGainPattern::GetAntennaGain_lin ( GeoCoordinate  coord,
Ptr< SatMobilityModel mobility 
) const

Calculate the antenna gain value for a certain {latitude, longitude} point.

Parameters
mobilityThe mobility model of the associated satellite
Returns
The gain value in linear format

4-point bilinear interpolation R(x, y1) = (x2 - x)/(x2 - x1) * Q(x1, y1)) + (x - x1)/(x2 - x1) * Q(x2, y1); R(x, y2) = (x2 - x)/(x2 - x1) * Q(x1, y2)) + (x - x1)/(x2 - x1) * Q(x2, y2); R = (y2 - y)/(y2 - y1) * R(x, y1) + (y - y1)/(y2 - y1) * R(x, y2);

Definition at line 329 of file satellite-antenna-gain-pattern.cc.

References ns3::SatUtils::DbToLinear(), ns3::GeoCoordinate::GetLatitude(), ns3::GeoCoordinate::GetLongitude(), GetSatelliteOffset(), m_antennaPattern, m_latInterval, m_latitudes, m_longitudes, m_lonInterval, m_maxLat, m_maxLon, m_minLat, and m_minLon.

Referenced by IsValidPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetInstanceTypeId()

TypeId ns3::SatAntennaGainPattern::GetInstanceTypeId ( void  ) const
virtual

Get the type ID of instance.

Returns
the object TypeId

Definition at line 57 of file satellite-antenna-gain-pattern.cc.

References GetTypeId().

+ Here is the call graph for this function:

◆ GetSatelliteOffset()

void ns3::SatAntennaGainPattern::GetSatelliteOffset ( double &  latOffset,
double &  lonOffset,
Ptr< SatMobilityModel mobility 
) const

Definition at line 231 of file satellite-antenna-gain-pattern.cc.

References ns3::GeoCoordinate::GetLatitude(), ns3::GeoCoordinate::GetLongitude(), m_latDefaultSatellite, and m_lonDefaultSatellite.

Referenced by GetAntennaGain_lin(), and GetValidRandomPosition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::SatAntennaGainPattern::GetTypeId ( void  )
static

Get the type ID.

Returns
the object TypeId

Definition at line 41 of file satellite-antenna-gain-pattern.cc.

References m_minAcceptableAntennaGainInDb.

Referenced by GetInstanceTypeId().

+ Here is the caller graph for this function:

◆ GetValidRandomPosition()

GeoCoordinate ns3::SatAntennaGainPattern::GetValidRandomPosition ( Ptr< SatMobilityModel mobility) const

Get a valid random position under this spot-beam coverage.

Parameters
mobilityThe mobility model of the associated satellite
Returns
A valid random GeoCoordinate

Definition at line 253 of file satellite-antenna-gain-pattern.cc.

References GetSatelliteOffset(), m_latInterval, m_lonInterval, m_uniformRandomVariable, and m_validPositions.

+ Here is the call graph for this function:

◆ IsValidPosition()

bool ns3::SatAntennaGainPattern::IsValidPosition ( GeoCoordinate  coord,
TracedCallback< double >  cb,
Ptr< SatMobilityModel mobility 
) const

Check if a given position is under this spot-beam coverage.

Parameters
coordThe position to check for validity
mobilityThe mobility model of the associated satellite
Returns
Whether or not the given position is valid for this spot-beam

Definition at line 317 of file satellite-antenna-gain-pattern.cc.

References GetAntennaGain_lin(), ns3::GeoCoordinate::GetLatitude(), ns3::GeoCoordinate::GetLongitude(), ns3::SatUtils::LinearToDb(), and m_minAcceptableAntennaGainInDb.

+ Here is the call graph for this function:

◆ ReadAntennaPatternFromFile()

void ns3::SatAntennaGainPattern::ReadAntennaPatternFromFile ( std::string  filePathName)
private

Read the antenna gain pattern from a file.

Parameters
filePathNamePath and file name of the antenna pattern file

Definition at line 100 of file satellite-antenna-gain-pattern.cc.

References m_antennaPattern, m_latInterval, m_latitudes, m_longitudes, m_lonInterval, m_maxLat, m_maxLon, m_minAcceptableAntennaGainInDb, m_minLat, m_minLon, m_nanStrings, and m_validPositions.

Referenced by SatAntennaGainPattern().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_antennaPattern

std::vector<std::vector<double> > ns3::SatAntennaGainPattern::m_antennaPattern
private

Container for the antenna pattern from one spot-beam.

  • Outer vector holds gain values for all latitudes
  • Inner vector holds gain values for all longitudes for a certain latitude

Definition at line 124 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_latDefaultSatellite

double ns3::SatAntennaGainPattern::m_latDefaultSatellite
private

Latitude of default satellite for antenna gain pattern.

Definition at line 187 of file satellite-antenna-gain-pattern.h.

Referenced by SatAntennaGainPattern(), and GetSatelliteOffset().

◆ m_latInterval

double ns3::SatAntennaGainPattern::m_latInterval
private

Interval between latitudes, must be constant.

Definition at line 177 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), GetValidRandomPosition(), and ReadAntennaPatternFromFile().

◆ m_latitudes

std::vector<double> ns3::SatAntennaGainPattern::m_latitudes
private

All valid latitudes from the file.

Definition at line 147 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_lonDefaultSatellite

double ns3::SatAntennaGainPattern::m_lonDefaultSatellite
private

Longitude of default satellite for antenna gain pattern.

Definition at line 192 of file satellite-antenna-gain-pattern.h.

Referenced by SatAntennaGainPattern(), and GetSatelliteOffset().

◆ m_longitudes

std::vector<double> ns3::SatAntennaGainPattern::m_longitudes
private

All valid latitudes from the file.

Definition at line 152 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_lonInterval

double ns3::SatAntennaGainPattern::m_lonInterval
private

Interval between longitudes, must be constant.

Definition at line 182 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), GetValidRandomPosition(), and ReadAntennaPatternFromFile().

◆ m_maxLat

double ns3::SatAntennaGainPattern::m_maxLat
private

Maximum latitude value of the antenna gain pattern.

Definition at line 167 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_maxLon

double ns3::SatAntennaGainPattern::m_maxLon
private

Minimum longitude value of the antenna gain pattern.

Definition at line 172 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_minAcceptableAntennaGainInDb

double ns3::SatAntennaGainPattern::m_minAcceptableAntennaGainInDb
private

Minimum acceptable antenna gain for a serving spot-beam.

Used for beam selection.

Definition at line 137 of file satellite-antenna-gain-pattern.h.

Referenced by GetTypeId(), IsValidPosition(), and ReadAntennaPatternFromFile().

◆ m_minLat

double ns3::SatAntennaGainPattern::m_minLat
private

Minimum latitude value of the antenna gain pattern.

Definition at line 157 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_minLon

double ns3::SatAntennaGainPattern::m_minLon
private

Minimum longitude value of the antenna gain pattern.

Definition at line 162 of file satellite-antenna-gain-pattern.h.

Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().

◆ m_nanStringArray

const std::string ns3::SatAntennaGainPattern::m_nanStringArray = {"nan", "NaN", "Nan", "NAN"}
staticprivate

Valid Not-a-Number (NaN) strings.

Definition at line 197 of file satellite-antenna-gain-pattern.h.

◆ m_nanStrings

std::vector<std::string> ns3::SatAntennaGainPattern::m_nanStrings
private

Definition at line 198 of file satellite-antenna-gain-pattern.h.

Referenced by ReadAntennaPatternFromFile().

◆ m_uniformRandomVariable

Ptr<UniformRandomVariable> ns3::SatAntennaGainPattern::m_uniformRandomVariable
private

Uniform random variable used for beam selection.

Definition at line 142 of file satellite-antenna-gain-pattern.h.

Referenced by SatAntennaGainPattern(), and GetValidRandomPosition().

◆ m_validPositions

std::vector<std::pair<double, double> > ns3::SatAntennaGainPattern::m_validPositions
private

Container for valid positions.

  • Latitude
  • Longitude

Definition at line 131 of file satellite-antenna-gain-pattern.h.

Referenced by GetValidRandomPosition(), and ReadAntennaPatternFromFile().


The documentation for this class was generated from the following files: