merge ns-3-lena-dev and ns-3-antenna
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include "angles.h"
|
||||
|
||||
|
||||
@@ -46,6 +46,17 @@ std::ostream& operator<< (std::ostream& os, const Angles& a)
|
||||
return os;
|
||||
}
|
||||
|
||||
std::istream &operator >> (std::istream &is, Angles &a)
|
||||
{
|
||||
char c;
|
||||
is >> a.phi >> c >> a.theta;
|
||||
if (c != ':')
|
||||
{
|
||||
is.setstate (std::ios_base::failbit);
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
Angles::Angles ()
|
||||
: phi (0),
|
||||
|
||||
@@ -49,7 +49,11 @@ double RadiansToDegrees (double radians);
|
||||
*
|
||||
* struct holding the azimuth and inclination angles of spherical
|
||||
* coordinates. The notation is the one used in "Antenna Theory - Analysis
|
||||
* and Design", C.A. Balanis, Wiley, 2nd Ed., section 2.2 "Radiation pattern".
|
||||
* and Design", C.A. Balanis, Wiley, 2nd Ed., section 2.2 "Radiation
|
||||
* pattern".
|
||||
* This notation corresponds to the standard spherical coordinates, with phi
|
||||
* measured counterclockwise in the x-y plane off the x-axis, and
|
||||
* theta measured off the z-axis.
|
||||
*
|
||||
* ^
|
||||
* z |
|
||||
@@ -67,7 +71,7 @@ double RadiansToDegrees (double radians);
|
||||
struct Angles
|
||||
{
|
||||
/**
|
||||
* default constructor, will inizialize phi and theta to zero
|
||||
* default constructor, will initialize phi and theta to zero
|
||||
*
|
||||
*/
|
||||
Angles ();
|
||||
@@ -124,7 +128,16 @@ struct Angles
|
||||
* \return a reference to the output stream
|
||||
*/
|
||||
std::ostream& operator<< ( std::ostream& os, const Angles& a);
|
||||
|
||||
|
||||
/**
|
||||
* initialize a struct Angles from input
|
||||
*
|
||||
* \param is the input stream
|
||||
* \param a the Angles struct
|
||||
*
|
||||
* \return a reference to the input stream
|
||||
*/
|
||||
std::istream &operator >> (std::istream &is, Angles &a);
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include "antenna-model.h"
|
||||
|
||||
|
||||
|
||||
@@ -34,10 +34,10 @@ namespace ns3 {
|
||||
*
|
||||
* This class provides an interface for the definition of antenna
|
||||
* radiation pattern models. This interface is based on the use of
|
||||
* spherical coordinates, in particolar of the azimuth and inclination
|
||||
* spherical coordinates, in particular of the azimuth and inclination
|
||||
* angles. This choice is the one proposed "Antenna Theory - Analysis
|
||||
* and Design", C.A. Balanis, Wiley, 2nd Ed., see in particular
|
||||
* section 2.2 "Radiation pattern".
|
||||
* section 2.2 "Radiation pattern".
|
||||
*
|
||||
*
|
||||
*/
|
||||
@@ -59,7 +59,10 @@ public:
|
||||
* \param the spherical angles at which the radiation pattern should
|
||||
* be evaluated
|
||||
*
|
||||
* \return the gain in dB of the antenna radiation pattern at the specified angles
|
||||
* \return the power gain in dBi of the antenna radiation pattern at
|
||||
* the specified angles; dBi means dB with respect to the gain of an
|
||||
* isotropic radiator. Since a power gain is used, the efficiency of
|
||||
* the antenna is expected to be included in the gain value.
|
||||
*/
|
||||
virtual double GetGainDb (Angles a) = 0;
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/double.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "antenna-model.h"
|
||||
#include "cosine-antenna-model.h"
|
||||
@@ -112,7 +112,7 @@ CosineAntennaModel::GetGainDb (Angles a)
|
||||
double ef = pow (cos (phi / 2.0), m_exponent);
|
||||
|
||||
// the array factor is not considered. Note that if we did consider
|
||||
// the array factor, the actual beawidth would change, and in
|
||||
// the array factor, the actual beamwidth would change, and in
|
||||
// particular it would be different from the one specified by the
|
||||
// user. Hence it is not desirable to use the array factor, for the
|
||||
// ease of use of this model.
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/double.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
#include "antenna-model.h"
|
||||
#include "parabolic-antenna-model.h"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/antenna-model.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ns3/double.h>
|
||||
#include <ns3/cosine-antenna-model.h>
|
||||
#include <ns3/simulator.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/antenna-model.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <ns3/log.h>
|
||||
#include <ns3/test.h>
|
||||
#include <ns3/isotropic-antenna-model.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <ns3/double.h>
|
||||
#include <ns3/parabolic-antenna-model.h>
|
||||
#include <ns3/simulator.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
Reference in New Issue
Block a user