antenna: allow non-unitary gain for IsotropicAntennaModel
This commit is contained in:
@@ -20,11 +20,13 @@
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/double.h>
|
||||
|
||||
#include "antenna-model.h"
|
||||
#include "isotropic-antenna-model.h"
|
||||
|
||||
|
||||
|
||||
namespace ns3 {
|
||||
|
||||
NS_LOG_COMPONENT_DEFINE ("IsotropicAntennaModel");
|
||||
@@ -39,6 +41,11 @@ IsotropicAntennaModel::GetTypeId ()
|
||||
.SetParent<AntennaModel> ()
|
||||
.SetGroupName("Antenna")
|
||||
.AddConstructor<IsotropicAntennaModel> ()
|
||||
.AddAttribute ("Gain",
|
||||
"The gain of the antenna in dB",
|
||||
DoubleValue (0),
|
||||
MakeDoubleAccessor (&IsotropicAntennaModel::m_gainDb),
|
||||
MakeDoubleChecker<double> ())
|
||||
;
|
||||
return tid;
|
||||
}
|
||||
@@ -52,7 +59,7 @@ double
|
||||
IsotropicAntennaModel::GetGainDb (Angles a)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << a);
|
||||
return 0.0;
|
||||
return m_gainDb;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ns3 {
|
||||
/**
|
||||
* \brief Isotropic antenna model
|
||||
*
|
||||
* This is the simplest antenna model. The gain of this antenna is unitary (=0dB) in all directions.
|
||||
* This is the simplest antenna model. The gain of this antenna is the same in all directions.
|
||||
*/
|
||||
class IsotropicAntennaModel : public AntennaModel
|
||||
{
|
||||
@@ -42,6 +42,14 @@ public:
|
||||
|
||||
// inherited from AntennaModel
|
||||
virtual double GetGainDb (Angles a);
|
||||
|
||||
protected:
|
||||
|
||||
/**
|
||||
* gain of the antenna in dB, in all directions
|
||||
*
|
||||
*/
|
||||
double m_gainDb;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user