23 #include <ns3/double.h> 24 #include <ns3/cosine-antenna-model.h> 25 #include <ns3/simulator.h> 44 static std::string BuildNameString (
Angles a,
double b,
double o,
double g);
49 virtual void DoRun (
void);
61 std::ostringstream oss;
62 oss <<
"theta=" << a.
theta <<
" , phi=" << a.
phi 63 <<
", beamdwidth=" << b <<
"deg" 64 <<
", orientation=" << o
65 <<
", maxGain=" << g <<
" dB";
71 :
TestCase (BuildNameString (a, b, o, g)),
76 m_expectedGain (expectedGainDb),
114 :
TestSuite (
"cosine-antenna-model", UNIT)
virtual double GetGainDb(Angles a)
this method is expected to be re-implemented by each antenna model
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
CosineAntennaModelGainTestCondition
double DegreesToRadians(double degrees)
converts degrees to radians
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
double theta
the inclination angle in radians
static std::string BuildNameString(Angles a, double b, double o, double g)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
static CosineAntennaModelTestSuite staticCosineAntennaModelTestSuiteInstance
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
CosineAntennaModelTestCase(Angles a, double b, double o, double g, double expectedGainDb, CosineAntennaModelGainTestCondition cond)
double phi
the azimuth angle in radians
#define NS_TEST_EXPECT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report if not.
CosineAntennaModelGainTestCondition m_cond
virtual void DoRun(void)
Implementation to actually run this TestCase.
struct holding the azimuth and inclination angles of spherical coordinates.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
CosineAntennaModelTestSuite()