Loading...
Searching...
No Matches
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.
 SatAntennaGainPattern (std::string filePathName, GeoCoordinate defaultSatellitePosition)
 Constructor with initialization parameters.
 ~SatAntennaGainPattern ()
double GetAntennaGain_lin (GeoCoordinate coord, Ptr< SatMobilityModel > mobility) const
 Calculate the antenna gain value for a certain {latitude, longitude} point.
double GetCenterLatitude (Ptr< SatMobilityModel > mobility) const
 Get latitude of this beam with best gain, based on satellite given in mobility model.
double GetCenterLongitude (Ptr< SatMobilityModel > mobility) const
 Get latitude of this beam with best gain, based on satellite given in mobility model.
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.
bool IsValidPosition (GeoCoordinate coord, TracedCallback< double > cb, Ptr< SatMobilityModel > mobility) const
 Check if a given position is under this spot-beam coverage.
virtual void NotifyConstructionCompleted () override
 Notifier called once the ObjectBase is fully constructed.

Static Public Member Functions

static TypeId GetTypeId (void)
 Get the type ID.

Private Member Functions

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

Private Attributes

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

Static Private Attributes

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

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 55 of file satellite-antenna-gain-pattern.h.

Constructor & Destructor Documentation

◆ SatAntennaGainPattern() [1/2]

◆ 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 84 of file satellite-antenna-gain-pattern.cc.

References m_defaultSatellitePosition, m_filePathName, m_nanStringArray, and m_nanStrings.

◆ ~SatAntennaGainPattern()

ns3::SatAntennaGainPattern::~SatAntennaGainPattern ( )
inline

Definition at line 86 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 381 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:

◆ GetCenterLatitude()

double ns3::SatAntennaGainPattern::GetCenterLatitude ( Ptr< SatMobilityModel > mobility) const

Get latitude of this beam with best gain, based on satellite given in mobility model.

Parameters
mobilityThe mobility model of the associated satellite
Returns
Latitude with best gain.

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

References ns3::GeoCoordinate::GetLatitude(), m_centerLatitude, and m_latDefaultSatellite.

Here is the call graph for this function:

◆ GetCenterLongitude()

double ns3::SatAntennaGainPattern::GetCenterLongitude ( Ptr< SatMobilityModel > mobility) const

Get latitude of this beam with best gain, based on satellite given in mobility model.

Parameters
mobilityThe mobility model of the associated satellite
Returns
Longitude with best gain.

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

References ns3::GeoCoordinate::GetLongitude(), m_centerLongitude, and m_lonDefaultSatellite.

Here is the call graph for this function:

◆ GetSatelliteOffset()

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

Definition at line 249 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 49 of file satellite-antenna-gain-pattern.cc.

References m_minAcceptableAntennaGainInDb.

◆ 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 305 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 369 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:

◆ NotifyConstructionCompleted()

void ns3::SatAntennaGainPattern::NotifyConstructionCompleted ( )
overridevirtual

Notifier called once the ObjectBase is fully constructed.

This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.

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

References m_defaultSatellitePosition, m_filePathName, m_latDefaultSatellite, m_lonDefaultSatellite, m_uniformRandomVariable, and ReadAntennaPatternFromFile().

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 109 of file satellite-antenna-gain-pattern.cc.

References m_antennaPattern, m_centerLatitude, m_centerLongitude, 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 NotifyConstructionCompleted().

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 146 of file satellite-antenna-gain-pattern.h.

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

◆ m_centerLatitude

double ns3::SatAntennaGainPattern::m_centerLatitude
private

Latitude with best gain.

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

Referenced by GetCenterLatitude(), and ReadAntennaPatternFromFile().

◆ m_centerLongitude

double ns3::SatAntennaGainPattern::m_centerLongitude
private

Longitude with best gain.

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

Referenced by GetCenterLongitude(), and ReadAntennaPatternFromFile().

◆ m_defaultSatellitePosition

GeoCoordinate ns3::SatAntennaGainPattern::m_defaultSatellitePosition
private

◆ m_filePathName

std::string ns3::SatAntennaGainPattern::m_filePathName
private

◆ m_latDefaultSatellite

double ns3::SatAntennaGainPattern::m_latDefaultSatellite
private

Latitude of default satellite for antenna gain pattern.

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

Referenced by SatAntennaGainPattern(), GetCenterLatitude(), GetSatelliteOffset(), and NotifyConstructionCompleted().

◆ m_latInterval

double ns3::SatAntennaGainPattern::m_latInterval
private

Interval between latitudes, must be constant.

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

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

◆ m_latitudes

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

All valid latitudes from the file.

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

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

◆ m_lonDefaultSatellite

double ns3::SatAntennaGainPattern::m_lonDefaultSatellite
private

Longitude of default satellite for antenna gain pattern.

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

Referenced by SatAntennaGainPattern(), GetCenterLongitude(), GetSatelliteOffset(), and NotifyConstructionCompleted().

◆ m_longitudes

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

All valid latitudes from the file.

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

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

◆ m_lonInterval

double ns3::SatAntennaGainPattern::m_lonInterval
private

Interval between longitudes, must be constant.

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

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

◆ m_maxLat

double ns3::SatAntennaGainPattern::m_maxLat
private

Maximum latitude value of the antenna gain pattern.

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

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

◆ m_maxLon

double ns3::SatAntennaGainPattern::m_maxLon
private

Minimum longitude value of the antenna gain pattern.

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

Referenced by SatAntennaGainPattern(), 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 159 of file satellite-antenna-gain-pattern.h.

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

◆ m_minLat

double ns3::SatAntennaGainPattern::m_minLat
private

Minimum latitude value of the antenna gain pattern.

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

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

◆ m_minLon

double ns3::SatAntennaGainPattern::m_minLon
private

Minimum longitude value of the antenna gain pattern.

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

Referenced by SatAntennaGainPattern(), 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 229 of file satellite-antenna-gain-pattern.h.

Referenced by SatAntennaGainPattern().

◆ m_nanStrings

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

◆ m_uniformRandomVariable

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

Uniform random variable used for beam selection.

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

Referenced by SatAntennaGainPattern(), GetValidRandomPosition(), and NotifyConstructionCompleted().

◆ m_validPositions

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

Container for valid positions.

  • Latitude
  • Longitude

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

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


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