Skip to content

Commit

Permalink
antenna: allow non-unitary gain for IsotropicAntennaModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicola Baldo committed Aug 14, 2018
1 parent 26df85d commit 64b9588
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/antenna/model/isotropic-antenna-model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
}
Expand All @@ -52,7 +59,7 @@ double
IsotropicAntennaModel::GetGainDb (Angles a)
{
NS_LOG_FUNCTION (this << a);
return 0.0;
return m_gainDb;
}

}
Expand Down
10 changes: 9 additions & 1 deletion src/antenna/model/isotropic-antenna-model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -42,6 +42,14 @@ class IsotropicAntennaModel : public AntennaModel

// inherited from AntennaModel
virtual double GetGainDb (Angles a);

protected:

/**
* gain of the antenna in dB, in all directions
*
*/
double m_gainDb;
};


Expand Down

0 comments on commit 64b9588

Please sign in to comment.