SatAntennaGainPattern class holds the antenna gain pattern data for a one single spot-beam. More...
#include "satellite-antenna-gain-pattern.h"
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. | |
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 64 of file satellite-antenna-gain-pattern.cc.
References m_antennaPattern, m_latDefaultSatellite, m_latInterval, m_latitudes, m_lonDefaultSatellite, m_longitudes, m_lonInterval, m_maxLat, m_maxLon, m_minAcceptableAntennaGainInDb, m_minLat, m_minLon, m_nanStrings, m_uniformRandomVariable, and m_validPositions.
| 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 84 of file satellite-antenna-gain-pattern.cc.
References m_defaultSatellitePosition, m_filePathName, m_nanStringArray, and m_nanStrings.
|
inline |
Definition at line 86 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 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().
| 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 271 of file satellite-antenna-gain-pattern.cc.
References ns3::GeoCoordinate::GetLatitude(), m_centerLatitude, and m_latDefaultSatellite.
| 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 288 of file satellite-antenna-gain-pattern.cc.
References ns3::GeoCoordinate::GetLongitude(), m_centerLongitude, and m_lonDefaultSatellite.
| 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().
|
static |
Get the type ID.
Definition at line 49 of file satellite-antenna-gain-pattern.cc.
References m_minAcceptableAntennaGainInDb.
| 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 305 of file satellite-antenna-gain-pattern.cc.
References GetSatelliteOffset(), m_latInterval, m_lonInterval, m_uniformRandomVariable, and m_validPositions.
| 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 369 of file satellite-antenna-gain-pattern.cc.
References GetAntennaGain_lin(), ns3::GeoCoordinate::GetLatitude(), ns3::GeoCoordinate::GetLongitude(), ns3::SatUtils::LinearToDb(), and m_minAcceptableAntennaGainInDb.
|
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().
|
private |
Read the antenna gain pattern from a file.
| filePathName | Path 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().
|
private |
Container for the antenna pattern from one spot-beam.
Definition at line 146 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), GetAntennaGain_lin(), and ReadAntennaPatternFromFile().
|
private |
Latitude with best gain.
Definition at line 179 of file satellite-antenna-gain-pattern.h.
Referenced by GetCenterLatitude(), and ReadAntennaPatternFromFile().
|
private |
Longitude with best gain.
Definition at line 184 of file satellite-antenna-gain-pattern.h.
Referenced by GetCenterLongitude(), and ReadAntennaPatternFromFile().
|
private |
Definition at line 233 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), and NotifyConstructionCompleted().
|
private |
Definition at line 232 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), and NotifyConstructionCompleted().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
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().
|
staticprivate |
Valid Not-a-Number (NaN) strings.
Definition at line 229 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern().
|
private |
Definition at line 230 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), SatAntennaGainPattern(), and ReadAntennaPatternFromFile().
|
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().
|
private |
Container for valid positions.
Definition at line 153 of file satellite-antenna-gain-pattern.h.
Referenced by SatAntennaGainPattern(), GetValidRandomPosition(), and ReadAntennaPatternFromFile().