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/three-gpp-antenna-array-model.h"
31 #include "ns3/three-gpp-channel-model.h"
32 #include "ns3/simple-net-device.h"
33 #include "ns3/simulator.h"
34 #include "ns3/channel-condition-model.h"
35 #include "ns3/three-gpp-spectrum-propagation-loss-model.h"
36 #include "ns3/wifi-spectrum-value-helper.h"
37 
38 using namespace ns3;
39 
40 NS_LOG_COMPONENT_DEFINE ("ThreeGppChannelTestSuite");
41 
48 {
49 public:
54 
59 
60 private:
64  virtual void DoRun (void);
65 
74  void DoComputeNorm (Ptr<ThreeGppChannelModel> channelModel, Ptr<MobilityModel> txMob, Ptr<MobilityModel> rxMob, Ptr<ThreeGppAntennaArrayModel> txAntenna, Ptr<ThreeGppAntennaArrayModel> rxAntenna);
75 
76  std::vector<double> m_normVector;
77 };
78 
80  : TestCase ("Check the dimensions and the norm of the channel matrix")
81 {
82 }
83 
85 {
86 }
87 
88 void
90 {
91  uint64_t txAntennaElements = txAntenna->GetNumberOfElements ();
92  uint64_t rxAntennaElements = rxAntenna->GetNumberOfElements ();
93 
94  Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
95 
96  double channelNorm = 0;
97  uint8_t numTotClusters = channelMatrix->m_channel.at (0).at (0).size ();
98  for (uint8_t cIndex = 0; cIndex < numTotClusters; cIndex++)
99  {
100  double clusterNorm = 0;
101  for (uint64_t sIndex = 0; sIndex < txAntennaElements; sIndex++)
102  {
103  for (uint32_t uIndex = 0; uIndex < rxAntennaElements; uIndex++)
104  {
105  clusterNorm += std::pow (std::abs (channelMatrix->m_channel.at (uIndex).at (sIndex).at (cIndex)), 2);
106  }
107  }
108  channelNorm += clusterNorm;
109  }
110  m_normVector.push_back (channelNorm);
111 }
112 
113 void
115 {
116  // Build the scenario for the test
117  uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
118  uint8_t rxAntennaElements[] {2, 2}; // rx antenna dimensions
119  uint32_t updatePeriodMs = 100; // update period in ms
120 
121  // create the channel condition model
122  Ptr<ChannelConditionModel> channelConditionModel = CreateObject<NeverLosChannelConditionModel> ();
123 
124  // create the ThreeGppChannelModel object used to generate the channel matrix
125  Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
126  channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
127  channelModel->SetAttribute ("Scenario", StringValue ("RMa"));
128  channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
129  channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs-1)));
130 
131  // create the tx and rx nodes
133  nodes.Create (2);
134 
135  // create the tx and rx devices
136  Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
137  Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
138 
139  // associate the nodes and the devices
140  nodes.Get (0)->AddDevice (txDev);
141  txDev->SetNode (nodes.Get (0));
142  nodes.Get (1)->AddDevice (rxDev);
143  rxDev->SetNode (nodes.Get (1));
144 
145  // create the tx and rx mobility models and set their positions
146  Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
147  txMob->SetPosition (Vector (0.0,0.0,10.0));
148  Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
149  rxMob->SetPosition (Vector (100.0,0.0,10.0));
150 
151  // associate the nodes and the mobility models
152  nodes.Get (0)->AggregateObject (txMob);
153  nodes.Get (1)->AggregateObject (rxMob);
154 
155  // create the tx and rx antennas and set the their dimensions
156  Ptr<ThreeGppAntennaArrayModel> txAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (txAntennaElements [0]), "NumRows", UintegerValue (txAntennaElements [1]), "IsotropicElements", BooleanValue (true));
157  Ptr<ThreeGppAntennaArrayModel> rxAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (rxAntennaElements [0]), "NumRows", UintegerValue (rxAntennaElements [1]), "IsotropicElements", BooleanValue (true));
158 
159  // generate the channel matrix
160  Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
161 
162  // check the channel matrix dimensions
163  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");
164  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");
165 
166  // test if the channel matrix is correctly generated
167  uint16_t numIt = 1000;
168  for (uint16_t i = 0; i < numIt; i++)
169  {
170  Simulator::Schedule (MilliSeconds (updatePeriodMs * i), &ThreeGppChannelMatrixComputationTest::DoComputeNorm, this, channelModel, txMob, rxMob, txAntenna, rxAntenna);
171  }
172 
173  Simulator::Run ();
174 
175  // compute the sample mean
176  double sampleMean = 0;
177  for (auto i : m_normVector)
178  {
179  sampleMean += i;
180  }
181  sampleMean /= numIt;
182 
183  // compute the sample standard deviation
184  double sampleStd = 0;
185  for (auto i : m_normVector)
186  {
187  sampleStd += ((i - sampleMean) * (i - sampleMean));
188  }
189  sampleStd = std::sqrt (sampleStd / (numIt - 1));
190 
191  // perform the one sample t-test with a significance level of 0.05 to test
192  // the hypothesis "E [|H|^2] = M*N, where |H| indicates the Frobenius norm of
193  // H, M is the number of transmit antenna elements, and N is the number of
194  // the receive antenna elements"
195  double t = (sampleMean - txAntennaElements [0] * txAntennaElements [1] * rxAntennaElements [0] * rxAntennaElements [1]) / (sampleMean / std::sqrt (numIt));
196 
197  // Using a significance level of 0.05, we reject the null hypothesis if |t| is
198  // greater than the critical value from a t-distribution with df = numIt-1
199  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");
200 
201  Simulator::Destroy ();
202 }
203 
210 {
211 public:
216 
221 
222 private:
226  virtual void DoRun (void);
227 
239 
241 };
242 
244  : TestCase ("Check if the channel realizations are correctly updated during the simulation")
245 {
246 }
247 
249 {
250 }
251 
252 void
254 {
255  // retrieve the channel matrix
256  Ptr<const ThreeGppChannelModel::ChannelMatrix> channelMatrix = channelModel->GetChannel (txMob, rxMob, txAntenna, rxAntenna);
257 
258  if (m_currentChannel == 0)
259  {
260  // this is the first time we compute the channel matrix, we initialize
261  // m_currentChannel
262  m_currentChannel = channelMatrix;
263  }
264  else
265  {
266  // compare the old and the new channel matrices
267  NS_TEST_ASSERT_MSG_EQ ((m_currentChannel != channelMatrix), update, Simulator::Now ().GetMilliSeconds () << " The channel matrix is not correctly updated");
268  }
269 }
270 
271 void
273 {
274  // Build the scenario for the test
275 
276  uint8_t txAntennaElements[] {2, 2}; // tx antenna dimensions
277  uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
278  uint32_t updatePeriodMs = 100; // update period in ms
279 
280  // create the channel condition model
281  Ptr<ChannelConditionModel> channelConditionModel = CreateObject<AlwaysLosChannelConditionModel> ();
282 
283  // create the ThreeGppChannelModel object used to generate the channel matrix
284  Ptr<ThreeGppChannelModel> channelModel = CreateObject<ThreeGppChannelModel> ();
285  channelModel->SetAttribute ("Frequency", DoubleValue (60.0e9));
286  channelModel->SetAttribute ("Scenario", StringValue ("UMa"));
287  channelModel->SetAttribute ("ChannelConditionModel", PointerValue (channelConditionModel));
288  channelModel->SetAttribute ("UpdatePeriod", TimeValue (MilliSeconds (updatePeriodMs)));
289 
290  // create the tx and rx nodes
292  nodes.Create (2);
293 
294  // create the tx and rx devices
295  Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
296  Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
297 
298  // associate the nodes and the devices
299  nodes.Get (0)->AddDevice (txDev);
300  txDev->SetNode (nodes.Get (0));
301  nodes.Get (1)->AddDevice (rxDev);
302  rxDev->SetNode (nodes.Get (1));
303 
304  // create the tx and rx mobility models and set their positions
305  Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
306  txMob->SetPosition (Vector (0.0,0.0,10.0));
307  Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
308  rxMob->SetPosition (Vector (100.0,0.0,1.6));
309 
310  // associate the nodes and the mobility models
311  nodes.Get (0)->AggregateObject (txMob);
312  nodes.Get (1)->AggregateObject (rxMob);
313 
314  // create the tx and rx antennas and set the their dimensions
315  Ptr<ThreeGppAntennaArrayModel> txAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (txAntennaElements [0]), "NumRows", UintegerValue (txAntennaElements [1]), "IsotropicElements", BooleanValue (true));
316  Ptr<ThreeGppAntennaArrayModel> rxAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (rxAntennaElements [0]), "NumRows", UintegerValue (rxAntennaElements [1]), "IsotropicElements", BooleanValue (true));
317 
318  // check if the channel matrix is correctly updated
319 
320  // compute the channel matrix for the first time
321  uint32_t firstTimeMs = 1; // time instant at which the channel matrix is generated for the first time
322  Simulator::Schedule (MilliSeconds (firstTimeMs), &ThreeGppChannelMatrixUpdateTest::DoGetChannel, this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
323 
324  // call GetChannel before the update period is exceeded, the channel matrix
325  // should not be updated
326  Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs / 2), &ThreeGppChannelMatrixUpdateTest::DoGetChannel, this, channelModel, txMob, rxMob, txAntenna, rxAntenna, false);
327 
328  // call GetChannel when the update period is exceeded, the channel matrix
329  // should be recomputed
330  Simulator::Schedule (MilliSeconds (firstTimeMs + updatePeriodMs + 1), &ThreeGppChannelMatrixUpdateTest::DoGetChannel, this, channelModel, txMob, rxMob, txAntenna, rxAntenna, true);
331 
332  Simulator::Run ();
333  Simulator::Destroy ();
334 }
335 
345 {
346 public:
351 
356 
357 private:
361  virtual void DoRun (void);
362 
370  void DoBeamforming (Ptr<NetDevice> thisDevice, Ptr<ThreeGppAntennaArrayModel> thisAntenna, Ptr<NetDevice> otherDevice, Ptr<ThreeGppAntennaArrayModel> otherAntenna);
371 
383 
391 };
392 
394  : TestCase ("Test case for the ThreeGppSpectrumPropagationLossModel class")
395 {
396 }
397 
399 {
400 }
401 
402 void
404 {
406 
407  Vector aPos = thisDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
408  Vector bPos = otherDevice->GetNode ()->GetObject<MobilityModel> ()->GetPosition ();
409 
410  // compute the azimuth and the elevation angles
411  Angles completeAngle (bPos,aPos);
412 
413  double hAngleRadian = fmod (completeAngle.phi, 2.0 * M_PI); // the azimuth angle
414  if (hAngleRadian < 0)
415  {
416  hAngleRadian += 2.0 * M_PI;
417  }
418  double vAngleRadian = completeAngle.theta; // the elevation angle
419 
420  int totNoArrayElements = thisAntenna->GetNumberOfElements ();
421  double power = 1 / sqrt (totNoArrayElements);
422 
423  for (int ind = 0; ind < totNoArrayElements; ind++)
424  {
425  Vector loc = thisAntenna->GetElementLocation (ind);
426  double phase = -2 * M_PI * (sin (vAngleRadian) * cos (hAngleRadian) * loc.x
427  + sin (vAngleRadian) * sin (hAngleRadian) * loc.y
428  + cos (vAngleRadian) * loc.z);
429  antennaWeights.push_back (exp (std::complex<double> (0, phase)) * power);
430  }
431 
432  thisAntenna->SetBeamformingVector (antennaWeights);
433 }
434 
435 bool
437 {
438  bool ret = true;
439  for (uint8_t i = 0; i < first->GetSpectrumModel ()->GetNumBands (); i++)
440  {
441  if ((*first) [i] != (*second) [i])
442  {
443  ret = false;
444  continue;
445  }
446  }
447  return ret;
448 }
449 
450 void
452 {
453  Ptr<SpectrumValue> rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txPsd, txMob, rxMob);
454  NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), false, "The long term is not updated when the channel matrix is recomputed");
455 }
456 
457 void
459 {
460  // Build the scenario for the test
461  Config::SetDefault ("ns3::ThreeGppChannelModel::UpdatePeriod", TimeValue (MilliSeconds (100)));
462 
463  uint8_t txAntennaElements[] {4, 4}; // tx antenna dimensions
464  uint8_t rxAntennaElements[] {4, 4}; // rx antenna dimensions
465 
466  // create the ChannelConditionModel object to be used to retrieve the
467  // channel condition
468  Ptr<ChannelConditionModel> condModel = CreateObject<AlwaysLosChannelConditionModel> ();
469 
470  // create the ThreeGppSpectrumPropagationLossModel object, set frequency,
471  // scenario and channel condition model to be used
472  Ptr<ThreeGppSpectrumPropagationLossModel> lossModel = CreateObject<ThreeGppSpectrumPropagationLossModel> ();
473  lossModel->SetChannelModelAttribute ("Frequency", DoubleValue(2.4e9));
474  lossModel->SetChannelModelAttribute ("Scenario", StringValue("UMa"));
475  lossModel->SetChannelModelAttribute ("ChannelConditionModel", PointerValue (condModel)); // create the ThreeGppChannelModel object used to generate the channel matrix
476 
477  // create the tx and rx nodes
479  nodes.Create (2);
480 
481  // create the tx and rx devices
482  Ptr<SimpleNetDevice> txDev = CreateObject<SimpleNetDevice> ();
483  Ptr<SimpleNetDevice> rxDev = CreateObject<SimpleNetDevice> ();
484 
485  // associate the nodes and the devices
486  nodes.Get (0)->AddDevice (txDev);
487  txDev->SetNode (nodes.Get (0));
488  nodes.Get (1)->AddDevice (rxDev);
489  rxDev->SetNode (nodes.Get (1));
490 
491  // create the tx and rx mobility models and set their positions
492  Ptr<MobilityModel> txMob = CreateObject<ConstantPositionMobilityModel> ();
493  txMob->SetPosition (Vector (0.0,0.0,10.0));
494  Ptr<MobilityModel> rxMob = CreateObject<ConstantPositionMobilityModel> ();
495  rxMob->SetPosition (Vector (15.0,0.0,10.0)); // in this position the channel condition is always LOS
496 
497  // associate the nodes and the mobility models
498  nodes.Get (0)->AggregateObject (txMob);
499  nodes.Get (1)->AggregateObject (rxMob);
500 
501  // create the tx and rx antennas and set the their dimensions
502  Ptr<ThreeGppAntennaArrayModel> txAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (txAntennaElements [0]), "NumRows", UintegerValue (txAntennaElements [1]));
503  Ptr<ThreeGppAntennaArrayModel> rxAntenna = CreateObjectWithAttributes<ThreeGppAntennaArrayModel> ("NumColumns", UintegerValue (rxAntennaElements [0]), "NumRows", UintegerValue (rxAntennaElements [1]));
504 
505  // initialize ThreeGppSpectrumPropagationLossModel
506  lossModel->AddDevice (txDev, txAntenna);
507  lossModel->AddDevice (rxDev, rxAntenna);
508 
509  // set the beamforming vectors
510  DoBeamforming (txDev, txAntenna, rxDev, rxAntenna);
511  DoBeamforming (rxDev, rxAntenna, txDev, txAntenna);
512 
513  // create the tx psd
515  double txPower = 0.1; // Watts
516  uint32_t channelNumber = 1;
517  Ptr<SpectrumValue> txPsd = sf.CreateTxPowerSpectralDensity (txPower, channelNumber);
518 
519  // compute the rx psd
520  Ptr<SpectrumValue> rxPsdOld = lossModel->DoCalcRxPowerSpectralDensity (txPsd, txMob, rxMob);
521 
522  // 1) check that the rx PSD is equal for both the direct and the reverse channel
523  Ptr<SpectrumValue> rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txPsd, rxMob, txMob);
524  NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), true, "The long term for the direct and the reverse channel are different");
525 
526  // 2) check if the long term is updated when changing the BF vector
527  // change the position of the rx device and recompute the beamforming vectors
528  rxMob->SetPosition (Vector (10.0, 5.0, 10.0));
530  txBfVector [0] = std::complex<double> (0.0, 0.0);
531  txAntenna->SetBeamformingVector (txBfVector);
532 
533  rxPsdNew = lossModel->DoCalcRxPowerSpectralDensity (txPsd, rxMob, txMob);
534  NS_TEST_ASSERT_MSG_EQ (ArePsdEqual (rxPsdOld, rxPsdNew), false, "Changing the BF vectors the rx PSD does not change");
535 
536  // update rxPsdOld
537  rxPsdOld = rxPsdNew;
538 
539  // 3) check if the long term is updated when the channel matrix is recomputed
540  Simulator::Schedule (MilliSeconds (101), &ThreeGppSpectrumPropagationLossModelTest::CheckLongTermUpdate, this, lossModel, txPsd, txMob, rxMob, rxPsdOld);
541 
542  Simulator::Run ();
543  Simulator::Destroy ();
544 }
545 
552 {
553 public:
558 };
559 
561  : TestSuite ("three-gpp-channel", UNIT)
562 {
563  AddTestCase (new ThreeGppChannelMatrixComputationTest, TestCase::QUICK);
564  AddTestCase (new ThreeGppChannelMatrixUpdateTest, TestCase::QUICK);
566 }
567 
virtual uint64_t GetNumberOfElements(void) const
Returns the number of antenna elements.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
AttributeValue implementation for Boolean.
Definition: boolean.h:36
std::vector< std::complex< double > > ComplexVector
type definition for complex vectors
Definition: second.py:1
Hold variables of type string.
Definition: string.h:41
A suite of tests to run.
Definition: test.h:1343
virtual Ptr< Node > GetNode(void) const =0
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1286
virtual void DoRun(void)
Build the test scenario.
double theta
the inclination angle in radians
Definition: angles.h:117
encapsulates test code
Definition: test.h:1153
static bool ArePsdEqual(Ptr< SpectrumValue > first, Ptr< SpectrumValue > second)
Checks if two PSDs are equal.
static Vector GetPosition(Ptr< Node > node)
Definition: wifi-ap.cc:96
Test case for the ThreeGppChannelModel class.
virtual Vector GetElementLocation(uint64_t index) const
Returns the location of the antenna element with the specified index assuming the left bottom corner ...
Keep track of the current position and velocity of an object.
virtual void SetNode(Ptr< Node > node)
nodes
Definition: first.py:32
AttributeValue implementation for Time.
Definition: nstime.h:1342
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
std::vector< double > m_normVector
each element is the norm of a channel realization
Hold an unsigned integer type.
Definition: uinteger.h:44
#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:166
Ptr< const ChannelMatrix > GetChannel(Ptr< const MobilityModel > aMob, Ptr< const MobilityModel > bMob, Ptr< const ThreeGppAntennaArrayModel > aAntenna, Ptr< const ThreeGppAntennaArrayModel > bAntenna) override
Looks for the channel matrix associated to the aMob and bMob pair in m_channelMap.
Test case for the ThreeGppSpectrumPropagationLossModelTest class.
#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:378
static ThreeGppChannelTestSuite myTestSuite
Complex3DVector m_channel
channel matrix H[u][s][n].
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
void SetBeamformingVector(const ComplexVector &beamformingVector)
Sets the beamforming vector to be used.
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...
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Hold objects of type Ptr<T>.
Definition: pointer.h:36
Test suite for the ThreeGppChannelModel class.
Ptr< const ThreeGppChannelModel::ChannelMatrix > m_currentChannel
used by DoGetChannel to store the current channel matrix
void DoGetChannel(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< ThreeGppAntennaArrayModel > txAntenna, Ptr< ThreeGppAntennaArrayModel > rxAntenna, bool update)
This method is used to schedule the channel matrix computation at different time instants and to chec...
const ComplexVector & GetBeamformingVector(void) const
Returns the beamforming vector that is currently being used.
void SetPosition(const Vector &position)
virtual void DoRun(void)
Build the test scenario.
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
double phi
the azimuth angle in radians
Definition: angles.h:111
void CheckLongTermUpdate(Ptr< ThreeGppSpectrumPropagationLossModel > lossModel, Ptr< SpectrumValue > txPsd, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< SpectrumValue > rxPsdOld)
Test of the long term component is correctly updated when the channel matrix is recomputed.
void DoComputeNorm(Ptr< ThreeGppChannelModel > channelModel, Ptr< MobilityModel > txMob, Ptr< MobilityModel > rxMob, Ptr< ThreeGppAntennaArrayModel > txAntenna, Ptr< ThreeGppAntennaArrayModel > rxAntenna)
Compute the Frobenius norm of the channel matrix and stores it in m_normVector.
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
void DoBeamforming(Ptr< NetDevice > thisDevice, Ptr< ThreeGppAntennaArrayModel > thisAntenna, Ptr< NetDevice > otherDevice, Ptr< ThreeGppAntennaArrayModel > otherAntenna)
Points the beam of thisDevice towards otherDevice.
Ptr< SpectrumValue > DoCalcRxPowerSpectralDensity(Ptr< const SpectrumValue > txPsd, Ptr< const MobilityModel > a, Ptr< const MobilityModel > b) const override
Computes the received PSD.
struct holding the azimuth and inclination angles of spherical coordinates.
Definition: angles.h:71
Test case for the ThreeGppChannelModel class.
Definition: first.py:1
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
Implements Wifi SpectrumValue for the 2.4 GHz ISM band only, with a 5 MHz spectrum resolution...
virtual void DoRun(void)
Build the test scenario.