|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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);
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
double GetInclination(void) const
Getter for inclination angle.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
double m_orientationRadians
orientation in radians in the horizontal direction (bearing)
static double GetBeamwidthFromExponent(double exponent)
Compute the beamwidth of the cosine antenna model from the exponent.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
virtual double GetGainDb(Angles a)
this method is expected to be re-implemented by each antenna model
double m_verticalExponent
exponent of the vertical direction
double GetVerticalBeamwidth(void) const
Get the vertical 3 dB beamwidth of the cosine antenna model.
void SetHorizontalBeamwidth(double horizontalBeamwidthDegrees)
Set the horizontal 3 dB beamwidth (bilateral) of the cosine antenna model.
interface for antenna radiation pattern models
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
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.
void SetVerticalBeamwidth(double verticalBeamwidthDegrees)
Set the vertical 3 dB beamwidth (bilateral) of the cosine antenna model.
Class holding the azimuth and inclination angles of spherical coordinates.
void SetAzimuth(double azimuth)
Setter for azimuth angle.
static double GetExponentFromBeamwidth(double beamwidthDegrees)
Compute the exponent of the cosine antenna model from the beamwidth.
double GetAzimuth(void) const
Getter for azimuth angle.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
double m_horizontalExponent
exponent of the horizontal direction
static TypeId GetTypeId()
double GetHorizontalBeamwidth(void) const
Get the horizontal 3 dB beamwidth of the cosine antenna model.
double m_maxGain
antenna gain in dB towards the main orientation
void SetOrientation(double orientationDegrees)
Set the horizontal orientation of the antenna element.
double GetOrientation(void) const
Get the horizontal orientation of the antenna element.
double DegreesToRadians(double degrees)
converts degrees to radians