23 #include <ns3/double.h> 42 .SetGroupName (
"Antenna")
44 .AddAttribute (
"VerticalBeamwidth",
45 "The 3 dB vertical beamwidth (degrees). A beamwidth of 360 deg corresponds to constant gain",
49 MakeDoubleChecker<double> (0, 360))
50 .AddAttribute (
"HorizontalBeamwidth",
51 "The 3 dB horizontal beamwidth (degrees). A beamwidth of 360 deg corresponds to constant gain",
55 MakeDoubleChecker<double> (0, 360))
56 .AddAttribute (
"Orientation",
57 "The angle (degrees) that expresses the orientation of the antenna on the x-y plane relative to the x axis",
61 MakeDoubleChecker<double> (-360, 360))
62 .AddAttribute (
"MaxGain",
63 "The gain (dB) at the antenna boresight (the direction of maximum gain)",
66 MakeDoubleChecker<double> ())
83 if (beamwidthDegrees == 360.0)
89 exponent = -3.0 / (20 * std::log10 (std::cos (
DegreesToRadians (beamwidthDegrees / 4.0))));
104 double beamwidthRadians = 4 * std::acos (std::pow (0.5, 1 / (2 * exponent)));
170 double gainDb = 10 * std::log10 (gain);
virtual double GetGainDb(Angles a)
this method is expected to be re-implemented by each antenna model
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
double m_orientationRadians
orientation in radians in the horizontal direction (bearing)
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
double DegreesToRadians(double degrees)
converts degrees to radians
Class holding the azimuth and inclination angles of spherical coordinates.
double m_horizontalExponent
exponent of the horizontal direction
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetHorizontalBeamwidth(double horizontalBeamwidthDegrees)
Set the horizontal 3 dB beamwidth (bilateral) of the cosine antenna model.
double m_verticalExponent
exponent of the vertical direction
double m_maxGain
antenna gain in dB towards the main orientation
double GetAzimuth(void) const
Getter for azimuth angle.
static TypeId GetTypeId()
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
double GetVerticalBeamwidth(void) const
Get the vertical 3 dB beamwidth of the cosine antenna model.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetAzimuth(double azimuth)
Setter for azimuth angle.
void SetVerticalBeamwidth(double verticalBeamwidthDegrees)
Set the vertical 3 dB beamwidth (bilateral) of the cosine antenna model.
void SetOrientation(double orientationDegrees)
Set the horizontal orientation of the antenna element.
static double GetExponentFromBeamwidth(double beamwidthDegrees)
Compute the exponent of the cosine antenna model from the beamwidth.
static double GetBeamwidthFromExponent(double exponent)
Compute the beamwidth of the cosine antenna model from the exponent.
double RadiansToDegrees(double radians)
converts radians to degrees
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
double GetInclination(void) const
Getter for inclination angle.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
interface for antenna radiation pattern models
double GetHorizontalBeamwidth(void) const
Get the horizontal 3 dB beamwidth of the cosine antenna model.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
double GetOrientation(void) const
Get the horizontal orientation of the antenna element.