9#include "ns3/channel-condition-model.h"
10#include "ns3/config.h"
11#include "ns3/constant-position-mobility-model.h"
12#include "ns3/double.h"
14#include "ns3/node-container.h"
15#include "ns3/simulator.h"
47 void DoRun()
override;
76 :
TestCase(
"Test case for the child classes of ThreeGppChannelConditionModel"),
91 if (cond->GetLosCondition() == ChannelCondition::LosConditionValue::LOS)
112 testVector.
m_pLos = exp(-(100.0 - 10.0) / 1000.0);
118 testVector.
m_pLos = exp(-(1000.0 - 10.0) / 1000.0);
131 testVector.
m_pLos = (18.0 / 50.0 + exp(-50.0 / 63.0) * (1.0 - 18.0 / 50.0)) * (1.0 + 0);
138 (18.0 / 50.0 + exp(-50.0 / 63.0) * (1.0 - 18.0 / 50.0)) *
139 (1.0 + pow(2.0 / 10.0, 1.5) * 5.0 / 4.0 * pow(50.0 / 100.0, 3) * exp(-50.0 / 150.0));
145 testVector.
m_pLos = (18.0 / 100.0 + exp(-100.0 / 63.0) * (1.0 - 18.0 / 100.0)) * (1.0 + 0);
151 testVector.
m_pLos = (18.0 / 100.0 + exp(-100.0 / 63.0) * (1.0 - 18.0 / 100.0)) *
152 (1.0 + pow(2.0 / 10.0, 1.5) * 5.0 / 4.0 * 1.0 * exp(-100.0 / 150.0));
165 testVector.
m_pLos = (18.0 / 50.0 + exp(-50.0 / 36.0) * (1.0 - 18.0 / 50.0));
172 testVector.
m_pLos = (18.0 / 100.0 + exp(-100.0 / 36.0) * (1.0 - 18.0 / 100.0));
185 testVector.
m_pLos = exp(-(5.0 - 1.2) / 4.7);
191 testVector.
m_pLos = exp(-(10.0 - 6.5) / 32.6) * 0.32;
204 testVector.
m_pLos = exp(-(30.0 - 5.0) / 70.8);
210 testVector.
m_pLos = exp(-(100.0 - 49.0) / 211.7) * 0.54;
245 for (
uint32_t j = 0; j < numberOfReps; j++)
260 <<
" numberOfReps " << numberOfReps <<
" resultPlos "
261 << resultPlos <<
" ref " << testVector.
m_pLos);
265 "Got unexpected LOS probability");
281 :
TestSuite(
"propagation-channel-condition-model",
Type::UNIT)
static ChannelConditionModelsTestSuite g_channelConditionModelsTestSuite
Static variable for test initialization.
Test suite for the channel condition models.
ChannelConditionModelsTestSuite()
Test case for the 3GPP channel condition models.
void DoRun() override
Builds the simulation scenario and perform the tests.
void EvaluateChannelCondition(Ptr< MobilityModel > a, Ptr< MobilityModel > b)
Evaluates the channel condition between two nodes by calling the method GetChannelCondition on m_cond...
Ptr< ThreeGppChannelConditionModel > m_condModel
the channel condition model
ThreeGppChannelConditionModelTestCase()
Constructor.
TestVectors< TestVector > m_testVectors
array containing all the test vectors
~ThreeGppChannelConditionModelTestCase() override
Destructor.
double m_tolerance
tolerance
uint64_t m_numLos
the number of LOS occurrences
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Instantiate subclasses of ns3::Object.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
static void Run()
Run the simulation.
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
A simple way to store test vectors (for stimulus or from responses)
Base class for the 3GPP channel condition models.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
AttributeValue implementation for Time.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#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 ...
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Struct containing the parameters for each test.
double m_pLos
LOS probability.
Vector m_positionA
the position of the first node
Vector m_positionB
the position of the second node
TypeId m_typeId
the type ID of the channel condition model to be used