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:
 Inheritance diagram for ns3::SatAntennaGainPattern: Collaboration 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... | |
| double | GetCenterLatitude (Ptr< SatMobilityModel > mobility) const | 
| Get latitude of this beam with best gain, based on satellite given in mobility model.  More... | |
| double | GetCenterLongitude (Ptr< SatMobilityModel > mobility) const | 
| Get latitude of this beam with best gain, based on satellite given in mobility model.  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_centerLatitude | 
| Latitude with best gain.  More... | |
| double | m_centerLongitude | 
| Longitude with best gain.  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... | |
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.
| ns3::SatAntennaGainPattern::SatAntennaGainPattern | ( | ) | 
Default constructor.
Definition at line 70 of file satellite-antenna-gain-pattern.cc.
| ns3::SatAntennaGainPattern::SatAntennaGainPattern | ( | std::string | filePathName, | 
| GeoCoordinate | defaultSatellitePosition | ||
| ) | 
Constructor with initialization parameters.
| filePathName | Path of file to read antenna gain patterns | 
| defaultSatellitePosition | Position of satellite associated to this pattern | 
Definition at line 90 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:
 Here is the call graph for this function:| 
 | inline | 
Definition at line 82 of file satellite-antenna-gain-pattern.h.
| double ns3::SatAntennaGainPattern::GetAntennaGain_lin | ( | GeoCoordinate | coord, | 
| Ptr< SatMobilityModel > | mobility | ||
| ) | const | 
Calculate the antenna gain value for a certain {latitude, longitude} point.
| mobility | The mobility model of the associated satellite | 
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 380 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 call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| double ns3::SatAntennaGainPattern::GetCenterLatitude | ( | Ptr< SatMobilityModel > | mobility | ) | const | 
Get latitude of this beam with best gain, based on satellite given in mobility model.
| mobility | The mobility model of the associated satellite | 
Definition at line 270 of file satellite-antenna-gain-pattern.cc.
References ns3::GeoCoordinate::GetLatitude(), m_centerLatitude, and m_latDefaultSatellite.
 Here is the call graph for this function:
 Here is the call graph for this function:| double ns3::SatAntennaGainPattern::GetCenterLongitude | ( | Ptr< SatMobilityModel > | mobility | ) | const | 
Get latitude of this beam with best gain, based on satellite given in mobility model.
| mobility | The mobility model of the associated satellite | 
Definition at line 287 of file satellite-antenna-gain-pattern.cc.
References ns3::GeoCoordinate::GetLongitude(), m_centerLongitude, and m_lonDefaultSatellite.
 Here is the call graph for this function:
 Here is the call graph for this function:| 
 | virtual | 
Get the type ID of instance.
Definition at line 65 of file satellite-antenna-gain-pattern.cc.
References GetTypeId().
 Here is the call graph for this function:
 Here is the call graph for this function:| void ns3::SatAntennaGainPattern::GetSatelliteOffset | ( | double & | latOffset, | 
| double & | lonOffset, | ||
| Ptr< SatMobilityModel > | mobility | ||
| ) | const | 
Definition at line 248 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 call graph for this function: Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | static | 
Get the type ID.
Definition at line 49 of file satellite-antenna-gain-pattern.cc.
References m_minAcceptableAntennaGainInDb.
Referenced by GetInstanceTypeId().
 Here is the caller graph for this function:
 Here is the caller graph for this function:| GeoCoordinate ns3::SatAntennaGainPattern::GetValidRandomPosition | ( | Ptr< SatMobilityModel > | mobility | ) | const | 
Get a valid random position under this spot-beam coverage.
| mobility | The mobility model of the associated satellite | 
Definition at line 304 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:
 Here is the call graph for this function:| bool ns3::SatAntennaGainPattern::IsValidPosition | ( | GeoCoordinate | coord, | 
| TracedCallback< double > | cb, | ||
| Ptr< SatMobilityModel > | mobility | ||
| ) | const | 
Check if a given position is under this spot-beam coverage.
| coord | The position to check for validity | 
| mobility | The mobility model of the associated satellite | 
Definition at line 368 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:
 Here is the call graph for this function:| 
 | private | 
Read the antenna gain pattern from a file.
| filePathName | Path and file name of the antenna pattern file | 
Definition at line 108 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 SatAntennaGainPattern().
 Here is the caller graph for this function:
 Here is the caller graph for this function:| 
 | private | 
Container for the antenna pattern from one spot-beam.
Definition at line 142 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Latitude with best gain.
Definition at line 175 of file satellite-antenna-gain-pattern.h.
Referenced by GetCenterLatitude(), and ReadAntennaPatternFromFile().
| 
 | private | 
Longitude with best gain.
Definition at line 180 of file satellite-antenna-gain-pattern.h.
Referenced by GetCenterLongitude(), and ReadAntennaPatternFromFile().
| 
 | private | 
Latitude of default satellite for antenna gain pattern.
Definition at line 215 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), GetCenterLatitude(), and GetSatelliteOffset().
| 
 | private | 
Interval between latitudes, must be constant.
Definition at line 205 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), GetValidRandomPosition(), and ReadAntennaPatternFromFile().
| 
 | private | 
All valid latitudes from the file.
Definition at line 165 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Longitude of default satellite for antenna gain pattern.
Definition at line 220 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), GetCenterLongitude(), and GetSatelliteOffset().
| 
 | private | 
All valid latitudes from the file.
Definition at line 170 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Interval between longitudes, must be constant.
Definition at line 210 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), GetValidRandomPosition(), and ReadAntennaPatternFromFile().
| 
 | private | 
Maximum latitude value of the antenna gain pattern.
Definition at line 195 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Minimum longitude value of the antenna gain pattern.
Definition at line 200 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Minimum acceptable antenna gain for a serving spot-beam.
Used for beam selection.
Definition at line 155 of file satellite-antenna-gain-pattern.h.
Referenced by GetTypeId(), IsValidPosition(), and ReadAntennaPatternFromFile().
| 
 | private | 
Minimum latitude value of the antenna gain pattern.
Definition at line 185 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | private | 
Minimum longitude value of the antenna gain pattern.
Definition at line 190 of file satellite-antenna-gain-pattern.h.
Referenced by GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
| 
 | staticprivate | 
Valid Not-a-Number (NaN) strings.
Definition at line 225 of file satellite-antenna-gain-pattern.h.
| 
 | private | 
Definition at line 226 of file satellite-antenna-gain-pattern.h.
Referenced by ReadAntennaPatternFromFile().
| 
 | private | 
Uniform random variable used for beam selection.
Definition at line 160 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), and GetValidRandomPosition().
| 
 | private | 
Container for valid positions.
Definition at line 149 of file satellite-antenna-gain-pattern.h.
Referenced by GetValidRandomPosition(), and ReadAntennaPatternFromFile().