12#include <ns3/building.h>
13#include <ns3/buildings-helper.h>
14#include <ns3/constant-position-mobility-model.h>
15#include <ns3/double.h>
17#include <ns3/hybrid-buildings-propagation-loss-model.h>
19#include <ns3/mobility-building-info.h>
20#include <ns3/mobility-model.h>
22#include <ns3/simulator.h>
23#include <ns3/string.h>
43 TestCase::Duration::QUICK);
47 TestCase::Duration::QUICK);
51 TestCase::Duration::QUICK);
66 :
TestCase(
"SHADOWING calculation: " + name),
67 m_mobilityModelIndex1(
m1),
68 m_mobilityModelIndex2(
m2),
86 building1->SetBoundaries(
Box(-3000, -1, -4000, 4000.0, 0.0, 12));
89 building1->SetNFloors(3);
94 std::vector<double> loss;
96 double sumSquared = 0.0;
98 for (
int i = 0; i < samples; i++)
102 double shadowingLoss = propagationLossModel->DoCalcRxPower(0.0, mma, mmb) +
m_lossRef;
103 double shadowingLoss2 = propagationLossModel->DoCalcRxPower(0.0, mma, mmb) +
m_lossRef;
107 "Shadowing is not constant for the same mobility model pair!");
108 loss.push_back(shadowingLoss);
109 sum += shadowingLoss;
110 sumSquared += (shadowingLoss * shadowingLoss);
112 double sampleMean = sum / samples;
113 double sampleVariance = (sumSquared - (sum * sum / samples)) / (samples - 1);
114 double sampleStd = std::sqrt(sampleVariance);
117 const double zn995 = 2.575829303549;
118 double ci = (zn995 * sampleStd) / std::sqrt(samples);
119 NS_LOG_INFO(
"SampleMean from simulation " << sampleMean <<
", sampleStd " << sampleStd
120 <<
", reference value " <<
m_sigmaRef <<
", CI(99%) "
128 const double zchi2_005 = 887.621135217515;
129 const double zchi2_995 = 1117.89045267865;
151 double henbHeight = 10.0;
159 mm->SetPosition(Vector(0.0, 0.0, hb));
164 mm->SetPosition(Vector(2000, 0.0, hm));
169 mm->SetPosition(Vector(100, 0.0, hm));
174 mm->SetPosition(Vector(900, 0.0, hm));
179 mm->SetPosition(Vector(-5, 0.0, hm));
184 mm->SetPosition(Vector(-5, 30, henbHeight));
189 mm->SetPosition(Vector(-2000, 0.0, hm));
194 mm->SetPosition(Vector(-100, 0.0, hm));
199 mm->SetPosition(Vector(0, 0.0, hm));
204 mm->SetPosition(Vector(-100, 0.0, henbHeight));
209 mm->SetPosition(Vector(-500, 0.0, henbHeight));
217 mm->AggregateObject(buildingInfo);
218 buildingInfo->MakeConsistent(mm);
static BuildingsShadowingTestSuite buildingsShadowingTestSuite
Static variable for test initialization.
uint16_t m_mobilityModelIndex2
Second MobilityModel Index.
~BuildingsShadowingTestCase() override
Ptr< MobilityModel > CreateMobilityModel(uint16_t index)
Create a mobility model based on its index.
uint16_t m_mobilityModelIndex1
First MobilityModel Index.
double m_lossRef
pathloss value (without shadowing)
void DoRun() override
Implementation to actually run this TestCase.
BuildingsShadowingTestCase(uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name)
Constructor.
double m_sigmaRef
pathloss standard deviation value reference value
BuildingsShadowingTestSuite()
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_TEST_ASSERT_MSG_LT(actual, limit, msg)
Test that an actual value is less than a limit and report and abort if not.
#define NS_TEST_ASSERT_MSG_GT(actual, limit, msg)
Test that an actual value is greater than a limit and report and abort if not.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
const double m1
First component modulus, 232 - 209.
const double m2
Second component modulus, 232 - 22853.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
@ LOG_LEVEL_ALL
Print everything.