A Discrete-Event Network Simulator
API
three-gpp-channel-test-suite.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2019 SIGNET Lab, Department of Information Engineering,
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#include "ns3/log.h"
20#include "ns3/abort.h"
21#include "ns3/test.h"
22#include "ns3/config.h"
23#include "ns3/double.h"
24#include "ns3/uinteger.h"
25#include "ns3/string.h"
26#include "ns3/angles.h"
27#include "ns3/pointer.h"
28#include "ns3/node-container.h"
29#include "ns3/constant-position-mobility-model.h"
30#include "ns3/uniform-planar-array.h"
31#include "ns3/isotropic-antenna-model.h"
32#include "ns3/three-gpp-channel-model.h"
33#include "ns3/simple-net-device.h"
34#include "ns3/simulator.h"
35#include "ns3/channel-condition-model.h"
36#include "ns3/three-gpp-spectrum-propagation-loss-model.h"
37#include "ns3/wifi-spectrum-value-helper.h"
38
39using namespace ns3;
40
41NS_LOG_COMPONENT_DEFINE ("ThreeGppChannelTestSuite");
42
51{
52public:
57
62
63private:
67 virtual void DoRun (void);
68
78
79 std::vector<double> m_normVector;
80};
81
83 : TestCase ("Check the dimensions and the norm of the channel matrix")
84{
85}
86
88{
89}
90
91void
93{
94 uint64_t txAntennaElements = txAntenna->GetNumberOfElements ();
95 uint64_t rxAntennaElements = rxAntenna->GetNumberOfElements ();
96
97 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
98
99 double channelNorm = 0;
100 uint8_t numTotClusters = channelMatrix->m_channel.at (0).at (0).size ();
101 for (uint8_t cIndex = 0; cIndex < numTotClusters; cIndex++)
102 {
103 double clusterNorm = 0;
104 for (uint64_t sIndex = 0; sIndex < txAntennaElements; sIndex++)
105 {
106 for (uint32_t uIndex = 0; uIndex < rxAntennaElements; uIndex++)
107 {
108 clusterNorm += std::pow (std::abs (channelMatrix->m_channel.at (uIndex).at (sIndex).at (cIndex)), 2);
109 }
110 }
111 channelNorm += clusterNorm;
112 }
113 m_normVector.push_back (channelNorm);
114}
115
116void
118{
119 // Build the scenario for the test
120 uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
121 uint8_t rxAntennaElements[] {2, 2}; // rx antenna dimensions
122 uint32_t updatePeriodMs = 100; // update period in ms
123
124 // create the channel condition model
125 Ptr<ChannelConditionModel> channelConditionModel = CreateObject<NeverLosChannelConditionModel> ();
126
127 // create the ThreeGppChannelModel object used to generate the channel matrix
128 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
129 channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
130 channelModel->SetAttribute ("Scenario", StringValue ("RMa"));
131 channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
132 channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs-1)));
133
134 // create the tx and rx nodes
136 nodes.Create (2);
137
138 // create the tx and rx devices
139 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
140 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
141
142 // associate the nodes and the devices
143 nodes.Get (0)->AddDevice (txDev);
144 txDev->SetNode (nodes.Get (0));
145 nodes.Get (1)->AddDevice (rxDev);
146 rxDev->SetNode (nodes.Get (1));
147
148 // create the tx and rx mobility models and set their positions
149 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
150 txMob->SetPosition (Vector (0.0,0.0,10.0));
151 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
152 rxMob->SetPosition (Vector (100.0,0.0,10.0));
153
154 // associate the nodes and the mobility models
155 nodes.Get (0)->AggregateObject (txMob);
156 nodes.Get (1)->AggregateObject (rxMob);
157
158 // create the tx and rx antennas and set the their dimensions
159 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
160 "NumRows", UintegerValue (txAntennaElements [1]),
161 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
162 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
163 "NumRows", UintegerValue (rxAntennaElements [1]),
164 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
165
166 // generate the channel matrix
167 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
168
169 // check the channel matrix dimensions
170 NS_TEST_ASSERT_MSG_EQ (channelMatrix->m_channel.at (0).size (), txAntennaElements [0] * txAntennaElements [1], "The second dimension of H should be equal to the number of tx antenna elements");
171 NS_TEST_ASSERT_MSG_EQ (channelMatrix->m_channel.size (), rxAntennaElements [0] * rxAntennaElements [1], "The first dimension of H should be equal to the number of rx antenna elements");
172
173 // test if the channel matrix is correctly generated
174 uint16_t numIt = 1000;
175 for (uint16_t i = 0; i < numIt; i++)
176 {
177 Simulator::Schedule (MilliSeconds (updatePeriodMs * i), &ThreeGppChannelMatrixComputationTest::DoComputeNorm, this, channelModel, txMob, rxMob, txAntenna, rxAntenna);
178 }
179
180 Simulator::Run ();
181
182 // compute the sample mean
183 double sampleMean = 0;
184 for (auto i : m_normVector)
185 {
186 sampleMean += i;
187 }
188 sampleMean /= numIt;
189
190 // compute the sample standard deviation
191 double sampleStd = 0;
192 for (auto i : m_normVector)
193 {
194 sampleStd += ((i - sampleMean) * (i - sampleMean));
195 }
196 sampleStd = std::sqrt (sampleStd / (numIt - 1));
197
198 // perform the one sample t-test with a significance level of 0.05 to test
199 // the hypothesis "E [|H|^2] = M*N, where |H| indicates the Frobenius norm of
200 // H, M is the number of transmit antenna elements, and N is the number of
201 // the receive antenna elements"
202 double t = (sampleMean - txAntennaElements [0] * txAntennaElements [1] * rxAntennaElements [0] * rxAntennaElements [1]) / (sampleMean / std::sqrt (numIt));
203
204 // Using a significance level of 0.05, we reject the null hypothesis if |t| is
205 // greater than the critical value from a t-distribution with df = numIt-1
206 NS_TEST_ASSERT_MSG_EQ_TOL (std::abs (t), 0, 1.65, "We reject the hypothesis E[|H|^2] = M*N with a significance level of 0.05");
207
208 Simulator::Destroy ();
209}
210
219{
220public:
225
230
231private:
235 virtual void DoRun (void);
236
247 void DoGetChannel (Ptr<ThreeGppChannelModel> channelModel, Ptr<MobilityModel> txMob, Ptr<MobilityModel> rxMob, Ptr<PhasedArrayModel> txAntenna, Ptr<PhasedArrayModel> rxAntenna, bool update);
248
250};
251
253 : TestCase ("Check if the channel realizations are correctly updated during the simulation")
254{
255}
256
258{
259}
260
261void
263{
264 // retrieve the channel matrix
265 Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
266
267 if (m_currentChannel == 0)
268 {
269 // this is the first time we compute the channel matrix, we initialize
270 // m_currentChannel
271 m_currentChannel = channelMatrix;
272 }
273 else
274 {
275 // compare the old and the new channel matrices
276 NS_TEST_ASSERT_MSG_EQ ((m_currentChannel != channelMatrix), update, Simulator::Now ().GetMilliSeconds () << " The channel matrix is not correctly updated");
277 }
278}
279
280void
282{
283 // Build the scenario for the test
284
285 uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
286 uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
287 uint32_t updatePeriodMs = 100; // update period in ms
288
289 // create the channel condition model
290 Ptr<ChannelConditionModel> channelConditionModel = CreateObject<AlwaysLosChannelConditionModel> ();
291
292 // create the ThreeGppChannelModel object used to generate the channel matrix
293 Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
294 channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
295 channelModel->SetAttribute ("Scenario", StringValue ("UMa"));
296 channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
297 channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs)));
298
299 // create the tx and rx nodes
301 nodes.Create (2);
302
303 // create the tx and rx devices
304 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
305 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
306
307 // associate the nodes and the devices
308 nodes.Get (0)->AddDevice (txDev);
309 txDev->SetNode (nodes.Get (0));
310 nodes.Get (1)->AddDevice (rxDev);
311 rxDev->SetNode (nodes.Get (1));
312
313 // create the tx and rx mobility models and set their positions
314 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
315 txMob->SetPosition (Vector (0.0,0.0,10.0));
316 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
317 rxMob->SetPosition (Vector (100.0,0.0,1.6));
318
319 // associate the nodes and the mobility models
320 nodes.Get (0)->AggregateObject (txMob);
321 nodes.Get (1)->AggregateObject (rxMob);
322
323 // create the tx and rx antennas and set the their dimensions
324 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
325 "NumRows", UintegerValue (txAntennaElements [1]),
326 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
327 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
328 "NumRows", UintegerValue (rxAntennaElements [1]),
329 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
330
331 // check if the channel matrix is correctly updated
332
333 // compute the channel matrix for the first time
334 uint32_t firstTimeMs = 1; // time instant at which the channel matrix is generated for the first time
335 Simulator::Schedule (MilliSeconds (firstTimeMs), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
336 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
337
338 // call GetChannel before the update period is exceeded, the channel matrix
339 // should not be updated
340 Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs / 2), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
341 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, false);
342
343 // call GetChannel when the update period is exceeded, the channel matrix
344 // should be recomputed
345 Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs + 1), &ThreeGppChannelMatrixUpdateTest::DoGetChannel,
346 this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
347
348 Simulator::Run ();
349 Simulator::Destroy ();
350}
351
359{
367
380 Ptr<PhasedArrayModel> pTxAntenna, Ptr<PhasedArrayModel> pRxAntenna)
381 {
382 lossModel = pLossModel;
383 txPsd = pTxPsd;
384 txMob = pTxMob;
385 rxMob = pRxMob;
386 rxPsdOld = pRxPsdOld;
387 txAntenna = pTxAntenna;
388 rxAntenna = pRxAntenna;
389 }
390};
391
403{
404public:
409
414
415private:
419 virtual void DoRun (void);
420
428 void DoBeamforming (Ptr<NetDevice> thisDevice, Ptr<PhasedArrayModel> thisAntenna, Ptr<NetDevice> otherDevice, Ptr<PhasedArrayModel> otherAntenna);
429
436
444};
445
447 : TestCase ("Test case for the ThreeGppSpectrumPropagationLossModel class")
448{
449}
450
452{
453}
454
455void
457{
458 Vector aPos = thisDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
459 Vector bPos = otherDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
460
461 // compute the azimuth and the elevation angles
462 Angles completeAngle (bPos,aPos);
463
464 PhasedArrayModel::ComplexVector antennaWeights = thisAntenna->GetBeamformingVector (completeAngle);
465 thisAntenna->SetBeamformingVector (antennaWeights);
466}
467
468bool
470{
471 bool ret = true;
472 for (uint8_t i = 0; i < first->GetSpectrumModel ()->GetNumBands (); i++)
473 {
474 if ((*first) [i] != (*second) [i])
475 {
476 ret = false;
477 continue;
478 }
479 }
480 return ret;
481}
482
483void
485{
486 Ptr<SpectrumValue> rxPsdNew = params.lossModel->DoCalcRxPowerSpectralDensity (params.txPsd, params.txMob, params.rxMob, params.txAntenna, params.rxAntenna);
487 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (params.rxPsdOld, rxPsdNew), false, "The long term is not updated when the channel matrix is recomputed");
488}
489
490void
492{
493 // Build the scenario for the test
494 Config::SetDefault ("ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue (MilliSeconds (100)));
495
496 uint8_t txAntennaElements[] {4, 4}; // tx antenna dimensions
497 uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
498
499 // create the ChannelConditionModel object to be used to retrieve the
500 // channel condition
501 Ptr<ChannelConditionModel> condModel = CreateObject<AlwaysLosChannelConditionModel> ();
502
503 // create the ThreeGppSpectrumPropagationLossModel object, set frequency,
504 // scenario and channel condition model to be used
505 Ptr<ThreeGppSpectrumPropagationLossModel> lossModel = CreateObject<ThreeGppSpectrumPropagationLossModel> ();
506 lossModel->SetChannelModelAttribute ("Frequency", DoubleValue(2.4e9));
507 lossModel->SetChannelModelAttribute ("Scenario", StringValue("UMa"));
508 lossModel->SetChannelModelAttribute ("ChannelConditionModel", PointerValue (condModel)); // create the ThreeGppChannelModel object used to generate the channel matrix
509
510 // create the tx and rx nodes
512 nodes.Create (2);
513
514 // create the tx and rx devices
515 Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
516 Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
517
518 // associate the nodes and the devices
519 nodes.Get (0)->AddDevice (txDev);
520 txDev->SetNode (nodes.Get (0));
521 nodes.Get (1)->AddDevice (rxDev);
522 rxDev->SetNode (nodes.Get (1));
523
524 // create the tx and rx mobility models and set their positions
525 Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
526 txMob->SetPosition (Vector (0.0,0.0,10.0));
527 Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
528 rxMob->SetPosition (Vector (15.0,0.0,10.0)); // in this position the channel condition is always LOS
529
530 // associate the nodes and the mobility models
531 nodes.Get (0)->AggregateObject (txMob);
532 nodes.Get (1)->AggregateObject (rxMob);
533
534 // create the tx and rx antennas and set the their dimensions
535 Ptr<PhasedArrayModel> txAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (txAntennaElements [0]),
536 "NumRows", UintegerValue (txAntennaElements [1]),
537 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
538 Ptr<PhasedArrayModel> rxAntenna = CreateObjectWithAttributes<UniformPlanarArray> ("NumColumns", UintegerValue (rxAntennaElements [0]),
539 "NumRows", UintegerValue (rxAntennaElements [1]),
540 "AntennaElement", PointerValue(CreateObject<IsotropicAntennaModel> ()));
541
542 // set the beamforming vectors
543 DoBeamforming (txDev, txAntenna, rxDev, rxAntenna);
544 DoBeamforming (rxDev, rxAntenna, txDev, txAntenna);
545
546 // create the tx psd
548 double txPower = 0.1; // Watts
549 uint32_t channelNumber = 1;
550 Ptr<SpectrumValue> txPsd = sf.CreateTxPowerSpectralDensity (txPower, channelNumber);
551
552 // compute the rx psd
553 Ptr<SpectrumValue> rxPsdOld = lossModel->DoCalcRxPowerSpectralDensity (txPsd, txMob, rxMob, txAntenna, rxAntenna);
554
555 // 1) check that the rx PSD is equal for both the direct and the reverse channel
556 Ptr<SpectrumValue> rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txPsd, rxMob, txMob, rxAntenna, txAntenna);
557 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), true, "The long term for the direct and the reverse channel are different");
558
559 // 2) check if the long term is updated when changing the BF vector
560 // change the position of the rx device and recompute the beamforming vectors
561 rxMob->SetPosition (Vector (10.0, 5.0, 10.0));
562 PhasedArrayModel::ComplexVector txBfVector = txAntenna->GetBeamformingVector ();
563 txBfVector [0] = std::complex<double> (0.0, 0.0);
564 txAntenna->SetBeamformingVector (txBfVector);
565
566 rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txPsd, rxMob, txMob, rxAntenna, txAntenna);
567 NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), false, "Changing the BF vectors the rx PSD does not change");
568
569 // update rxPsdOld
570 rxPsdOld = rxPsdNew;
571
572 // 3) check if the long term is updated when the channel matrix is recomputed
574 this, CheckLongTermUpdateParams (lossModel, txPsd, txMob, rxMob, rxPsdOld, txAntenna, rxAntenna));
575
576 Simulator::Run ();
577 Simulator::Destroy ();
578}
579
586{
587public:
592};
593
595 : TestSuite ("three-gpp-channel", UNIT)
596{
598 AddTestCase (new ThreeGppChannelMatrixUpdateTest, TestCase::QUICK);
600}
601
Test case for the ThreeGppChannelModel class.
virtual void DoRun(void)
Build the test scenario.
std::vector< double > m_normVector
each element is the norm of a channel realization
void DoComputeNorm(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > txAntenna, Ptr< PhasedArrayModel > rxAntenna)
Compute the Frobenius norm of the channel matrix and stores it in m_normVector.
Test case for the ThreeGppChannelModel class.
void DoGetChannel(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< PhasedArrayModel > txAntenna, Ptr< PhasedArrayModel > rxAntenna, bool update)
This method is used to schedule the channel matrix computation at different time instants and to chec...
virtual void DoRun(void)
Build the test scenario.
Ptr< const ThreeGppChannelModel::ChannelMatrix > m_currentChannel
used by DoGetChannel to store the current channel matrix
Test suite for the ThreeGppChannelModel class.
Test case for the ThreeGppSpectrumPropagationLossModelTest class.
static bool ArePsdEqual(Ptr< SpectrumValue > first, Ptr< SpectrumValue > second)
Checks if two PSDs are equal.
virtual void DoRun(void)
Build the test scenario.
void DoBeamforming(Ptr< NetDevice > thisDevice, Ptr< PhasedArrayModel > thisAntenna, Ptr< NetDevice > otherDevice, Ptr< PhasedArrayModel > otherAntenna)
Points the beam of thisDevice towards otherDevice.
void CheckLongTermUpdate(CheckLongTermUpdateParams &params)
Test of the long term component is correctly updated when the channel matrix is recomputed.
Class holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:119
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
Keep track of the current position and velocity of an object.
void SetPosition(const Vector &position)
virtual Ptr< Node > GetNode(void) const =0
keep track of a set of node pointers.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ComplexVector GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
virtual uint64_t GetNumberOfElements(void) const =0
Returns the number of antenna elements.
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
Hold variables of type string.
Definition: string.h:41
encapsulates test code
Definition: test.h:994
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
A suite of tests to run.
Definition: test.h:1188
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumValue > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b, Ptr< const PhasedArrayModel > aPhasedArrayModel, Ptr< const PhasedArrayModel > bPhasedArrayModel) const override
Computes the received PSD.
void SetChannelModelAttribute(const std::string &name, const AttributeValue &value)
Sets the value of an attribute belonging to the associated MatrixBasedChannelModel instance.
AttributeValue implementation for Time.
Definition: nstime.h:1308
Hold an unsigned integer type.
Definition: uinteger.h:44
Implements Wifi SpectrumValue for the 2.4 GHz ISM band only, with a 5 MHz spectrum resolution.
virtual Ptr< SpectrumValue > CreateTxPowerSpectralDensity(double txPower, uint8_t channel)
Creates a SpectrumValue instance that represents the TX Power Spectral Density of a wifi device corre...
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:141
#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...
Definition: test.h:323
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
Definition: first.py:1
nodes
Definition: first.py:32
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Definition: second.py:1
A structure that holds the parameters for the function CheckLongTermUpdate.
Ptr< ThreeGppSpectrumPropagationLossModel > lossModel
the ThreeGppSpectrumPropagationLossModel object used to compute the rx PSD
Ptr< MobilityModel > txMob
the mobility model of the tx device
Ptr< SpectrumValue > rxPsdOld
the previously received PSD
Ptr< PhasedArrayModel > rxAntenna
the antenna array of the rx device
Ptr< MobilityModel > rxMob
the mobility model of the rx device
CheckLongTermUpdateParams(Ptr< ThreeGppSpectrumPropagationLossModel > pLossModel, Ptr< SpectrumValue > pTxPsd, Ptr< MobilityModel > pTxMob, Ptr< MobilityModel > pRxMob, Ptr< SpectrumValue > pRxPsdOld, Ptr< PhasedArrayModel > pTxAntenna, Ptr< PhasedArrayModel > pRxAntenna)
Constructor.
Ptr< PhasedArrayModel > txAntenna
the antenna array of the tx device
Ptr< SpectrumValue > txPsd
the PSD of the tx signal
Complex3DVector m_channel
channel matrix H[u][s][n].
static ThreeGppChannelTestSuite myTestSuite
Static variable for test initialization.
static Vector GetPosition(Ptr< Node > node)
Definition: wifi-ap.cc:96