A Discrete-Event Network Simulator
API
tv-spectrum-transmitter-helper.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 University of Washington
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  * Author: Benjamin Cizdziel <ben.cizdziel@gmail.com>
19  */
20 
21 #include <ns3/log.h>
22 #include <cmath>
23 #include <list>
24 #include <vector>
25 #include <ns3/uinteger.h>
26 #include <ns3/double.h>
27 #include <ns3/isotropic-antenna-model.h>
28 #include <ns3/mobility-helper.h>
29 #include <ns3/position-allocator.h>
30 #include <ns3/geographic-positions.h>
32 
33 namespace ns3 {
34 
35 NS_LOG_COMPONENT_DEFINE ("TvSpectrumTransmitterHelper");
36 
38 const int northAmericaArrayLength = 84;
40 const double northAmericaStartFrequencies[84] = {0, 0, 54e6, 60e6, 66e6, 76e6,
41  82e6, 174e6, 180e6, 186e6, 192e6, 198e6, 204e6, 210e6, 470e6, 476e6, 482e6,
42  488e6, 494e6, 500e6, 506e6, 512e6, 518e6, 524e6, 530e6, 536e6, 542e6, 548e6,
43  554e6, 560e6, 566e6, 572e6, 578e6, 584e6, 590e6, 596e6, 602e6, 608e6, 614e6,
44  620e6, 626e6, 632e6, 638e6, 644e6, 650e6, 656e6, 662e6, 668e6, 674e6, 680e6,
45  686e6, 692e6, 698e6, 704e6, 710e6, 716e6, 722e6, 728e6, 734e6, 740e6, 746e6,
46  752e6, 758e6, 764e6, 770e6, 776e6, 782e6, 788e6, 794e6, 800e6, 806e6, 812e6,
47  818e6, 824e6, 830e6, 836e6, 842e6, 848e6, 854e6, 860e6, 866e6, 872e6, 878e6,
48  884e6};
50 const double northAmericaEndFrequencies[84] = {0, 0, 60e6, 66e6, 72e6, 82e6,
51  88e6, 180e6, 186e6, 192e6, 198e6, 204e6, 210e6, 216e6, 476e6, 482e6, 488e6,
52  494e6, 500e6, 506e6, 512e6, 518e6, 524e6, 530e6, 536e6, 542e6, 548e6, 554e6,
53  560e6, 566e6, 572e6, 578e6, 584e6, 590e6, 596e6, 602e6, 608e6, 614e6, 620e6,
54  626e6, 632e6, 638e6, 644e6, 650e6, 656e6, 662e6, 668e6, 674e6, 680e6, 686e6,
55  692e6, 698e6, 704e6, 710e6, 716e6, 722e6, 728e6, 734e6, 740e6, 746e6, 752e6,
56  758e6, 764e6, 770e6, 776e6, 782e6, 788e6, 794e6, 800e6, 806e6, 812e6, 818e6,
57  824e6, 830e6, 836e6, 842e6, 848e6, 854e6, 860e6, 866e6, 872e6, 878e6, 884e6,
58  890e6};
59 
61 const int europeArrayLength = 70;
63 const double europeStartFrequencies[70] = {0, 0, 0, 0, 0, 174e6, 181e6, 188e6,
64  195e6, 202e6, 209e6, 216e6, 223e6, 0, 0, 0, 0, 0, 0, 0, 0, 470e6, 478e6,
65  486e6, 494e6, 502e6, 510e6, 518e6, 526e6, 534e6, 542e6, 550e6, 558e6, 566e6,
66  574e6, 582e6, 590e6, 598e6, 606e6, 614e6, 622e6, 630e6, 638e6, 646e6, 654e6,
67  662e6, 670e6, 678e6, 686e6, 694e6, 702e6, 710e6, 718e6, 726e6, 734e6, 742e6,
68  750e6, 758e6, 766e6, 774e6, 782e6, 790e6, 798e6, 806e6, 814e6, 822e6, 830e6,
69  838e6, 846e6, 854e6};
71 const double europeEndFrequencies[70] = {0, 0, 0, 0, 0, 181e6, 188e6, 195e6,
72  202e6, 209e6, 216e6, 223e6, 230e6, 0, 0, 0, 0, 0, 0, 0, 0, 478e6, 486e6,
73  494e6, 502e6, 510e6, 518e6, 526e6, 534e6, 542e6, 550e6, 558e6, 566e6, 574e6,
74  582e6, 590e6, 598e6, 606e6, 614e6, 622e6, 630e6, 638e6, 646e6, 654e6, 662e6,
75  670e6, 678e6, 686e6, 694e6, 702e6, 710e6, 718e6, 726e6, 734e6, 742e6, 750e6,
76  758e6, 766e6, 774e6, 782e6, 790e6, 798e6, 806e6, 814e6, 822e6, 830e6, 838e6,
77  846e6, 854e6, 862e6};
78 
80 const int japanArrayLength = 63;
82 const double japanStartFrequencies[63] = {0, 90e6, 96e6, 102e6, 170e6, 176e6,
83  182e6, 188e6, 192e6, 198e6, 204e6, 210e6, 216e6, 470e6, 476e6, 482e6, 488e6,
84  494e6, 500e6, 506e6, 512e6, 518e6, 524e6, 530e6, 536e6, 542e6, 548e6, 554e6,
85  560e6, 566e6, 572e6, 578e6, 584e6, 590e6, 596e6, 602e6, 608e6, 614e6, 620e6,
86  626e6, 632e6, 638e6, 644e6, 650e6, 656e6, 662e6, 668e6, 674e6, 680e6, 686e6,
87  692e6, 698e6, 704e6, 710e6, 716e6, 722e6, 728e6, 734e6, 740e6, 746e6, 752e6,
88  758e6, 764e6};
90 const double japanEndFrequencies[63] = {0, 96e6, 102e6, 108e6, 176e6, 182e6,
91  188e6, 194e6, 198e6, 204e6, 210e6, 216e6, 222e6, 476e6, 482e6, 488e6, 494e6,
92  500e6, 506e6, 512e6, 518e6, 524e6, 530e6, 536e6, 542e6, 548e6, 554e6, 560e6,
93  566e6, 572e6, 578e6, 584e6, 590e6, 596e6, 602e6, 608e6, 614e6, 620e6, 626e6,
94  632e6, 638e6, 644e6, 650e6, 656e6, 662e6, 668e6, 674e6, 680e6, 686e6, 692e6,
95  698e6, 704e6, 710e6, 716e6, 722e6, 728e6, 734e6, 740e6, 746e6, 752e6, 758e6,
96  764e6, 770e6};
97 
99  : m_channel (0),
100  m_uniRand (CreateObject<UniformRandomVariable> ())
101 {
102  NS_LOG_FUNCTION (this);
103  m_factory.SetTypeId ("ns3::TvSpectrumTransmitter");
104 }
105 
107 {
108  m_channel = 0;
109  m_uniRand = 0;
110  NS_LOG_FUNCTION (this);
111 }
112 
113 void
115 {
116  NS_LOG_FUNCTION (this << c);
117  m_channel = c;
118 }
119 
120 void
122 {
123  m_factory.Set (name, val);
124 }
125 
126 
129 {
130  NS_LOG_FUNCTION (this);
131  NetDeviceContainer devCont;
132  //iterate over node container to make one transmitter for each given node
133  for (NodeContainer::Iterator i = nodeCont.Begin (); i != nodeCont.End (); ++i)
134  {
135  Ptr<Node> node = *i;
137  phy->CreateTvPsd ();
138  Ptr<NonCommunicatingNetDevice> dev = CreateObject<NonCommunicatingNetDevice> ();
139  NS_ASSERT (phy);
140  dev->SetPhy (phy);
141  NS_ASSERT (node);
142  phy->SetMobility (node->GetObject<MobilityModel> ());
143  NS_ASSERT (dev);
144  phy->SetDevice (dev);
146  phy->SetChannel (m_channel);
147  dev->SetChannel (m_channel);
148  node->AddDevice (dev);
149  devCont.Add (dev);
150  phy->Start ();
151  }
152  return devCont;
153 }
154 
155 
158  Region region,
159  uint16_t channelNumber)
160 {
161  NS_LOG_FUNCTION (this);
162  NetDeviceContainer devCont;
163  double startFrequency;
164  double channelBandwidth;
165  if (region == REGION_NORTH_AMERICA)
166  {
167  NS_ASSERT_MSG (channelNumber < northAmericaArrayLength,
168  "channel number " << channelNumber <<
169  " does not exist for this region");
170  NS_ASSERT_MSG (northAmericaStartFrequencies[channelNumber] != 0,
171  "channel number " << channelNumber <<
172  " does not exist for this region");
173  startFrequency = northAmericaStartFrequencies[channelNumber];
174  channelBandwidth = northAmericaEndFrequencies[channelNumber] -
175  northAmericaStartFrequencies[channelNumber];
176  }
177  else if (region == REGION_EUROPE)
178  {
179  NS_ASSERT_MSG (channelNumber < europeArrayLength,
180  "channel number " << channelNumber <<
181  " does not exist for this region");
182  NS_ASSERT_MSG (europeStartFrequencies[channelNumber] != 0,
183  "channel number " << channelNumber <<
184  " does not exist for this region");
185  startFrequency = europeStartFrequencies[channelNumber];
186  channelBandwidth = europeEndFrequencies[channelNumber] -
187  europeStartFrequencies[channelNumber];
188  }
189  else if (region == REGION_JAPAN)
190  {
191  NS_ASSERT_MSG (channelNumber < japanArrayLength,
192  "channel number " << channelNumber <<
193  " does not exist for this region");
194  NS_ASSERT_MSG (japanStartFrequencies[channelNumber] != 0,
195  "channel number " << channelNumber <<
196  " does not exist for this region");
197  startFrequency = japanStartFrequencies[channelNumber];
198  channelBandwidth = japanEndFrequencies[channelNumber] -
199  japanStartFrequencies[channelNumber];
200  }
201  //iterate over node container to make one transmitter for each given node
202  for (NodeContainer::Iterator i = nodeCont.Begin (); i != nodeCont.End (); ++i)
203  {
204  Ptr<Node> node = *i;
206  phy->SetAttribute ("StartFrequency", DoubleValue (startFrequency));
207  phy->SetAttribute ("ChannelBandwidth", DoubleValue (channelBandwidth));
208  phy->CreateTvPsd ();
209  Ptr<NonCommunicatingNetDevice> dev = CreateObject<NonCommunicatingNetDevice> ();
210  NS_ASSERT (phy);
211  dev->SetPhy (phy);
212  NS_ASSERT (node);
213  phy->SetMobility (node->GetObject<MobilityModel> ());
214  NS_ASSERT (dev);
215  phy->SetDevice (dev);
217  phy->SetChannel (m_channel);
218  dev->SetChannel (m_channel);
219  node->AddDevice (dev);
220  devCont.Add (dev);
221  phy->Start ();
222  }
223  return devCont;
224 }
225 
226 
229 {
230  NS_LOG_FUNCTION (this);
231  NetDeviceContainer devCont;
232  int index = 0;
233  DoubleValue startFrequency;
234  DoubleValue channelBandwidth;
235  //iterate over node container to make one transmitter for each given node
236  for (NodeContainer::Iterator i = nodeCont.Begin (); i != nodeCont.End (); ++i)
237  {
238  Ptr<Node> node = *i;
240  phy->GetAttribute ("StartFrequency", startFrequency);
241  phy->GetAttribute ("ChannelBandwidth", channelBandwidth);
242  phy->SetAttribute ("StartFrequency", DoubleValue (startFrequency.Get () +
243  (index * channelBandwidth.Get ())));
244  phy->CreateTvPsd ();
245  Ptr<NonCommunicatingNetDevice> dev = CreateObject<NonCommunicatingNetDevice> ();
246  NS_ASSERT (phy);
247  dev->SetPhy (phy);
248  NS_ASSERT (node);
249  phy->SetMobility (node->GetObject<MobilityModel> ());
250  NS_ASSERT (dev);
251  phy->SetDevice (dev);
253  phy->SetChannel (m_channel);
254  dev->SetChannel (m_channel);
255  node->AddDevice (dev);
256  devCont.Add (dev);
257  phy->Start ();
258  index++;
259  }
260  return devCont;
261 }
262 
263 
266  Region region,
267  uint16_t channelNumber)
268 {
269  NS_LOG_FUNCTION (this);
270  NetDeviceContainer devCont;
271  double startFrequency;
272  double channelBandwidth;
273  uint16_t currChannelNumber;
274  int index = 0;
275  //iterate over node container to make one transmitter for each given node
276  for (NodeContainer::Iterator i = nodeCont.Begin (); i != nodeCont.End (); ++i)
277  {
278  currChannelNumber = channelNumber + index;
279  if (region == REGION_NORTH_AMERICA)
280  {
281  NS_ASSERT_MSG (currChannelNumber < northAmericaArrayLength,
282  "channel number " << currChannelNumber <<
283  " does not exist for this region");
284  NS_ASSERT_MSG (northAmericaStartFrequencies[currChannelNumber] != 0,
285  "channel number " << currChannelNumber <<
286  " does not exist for this region");
287  startFrequency = northAmericaStartFrequencies[currChannelNumber];
288  channelBandwidth = northAmericaEndFrequencies[currChannelNumber]
289  - northAmericaStartFrequencies[currChannelNumber];
290  }
291  else if (region == REGION_EUROPE)
292  {
293  NS_ASSERT_MSG (currChannelNumber < europeArrayLength,
294  "channel number " << currChannelNumber <<
295  " does not exist for this region");
296  NS_ASSERT_MSG (europeStartFrequencies[currChannelNumber] != 0,
297  "channel number " << currChannelNumber <<
298  " does not exist for this region");
299  startFrequency = europeStartFrequencies[currChannelNumber];
300  channelBandwidth = europeEndFrequencies[currChannelNumber] -
301  europeStartFrequencies[currChannelNumber];
302  }
303  else if (region == REGION_JAPAN)
304  {
305  NS_ASSERT_MSG (currChannelNumber < japanArrayLength,
306  "channel number " << currChannelNumber <<
307  " does not exist for this region");
308  NS_ASSERT_MSG (japanStartFrequencies[currChannelNumber] != 0,
309  "channel number " << currChannelNumber <<
310  " does not exist for this region");
311  startFrequency = japanStartFrequencies[currChannelNumber];
312  channelBandwidth = japanEndFrequencies[currChannelNumber] -
313  japanStartFrequencies[currChannelNumber];
314  }
315  Ptr<Node> node = *i;
317  phy->SetAttribute ("StartFrequency", DoubleValue (startFrequency));
318  phy->SetAttribute ("ChannelBandwidth", DoubleValue (channelBandwidth));
319  phy->CreateTvPsd ();
320  Ptr<NonCommunicatingNetDevice> dev = CreateObject<NonCommunicatingNetDevice> ();
321  NS_ASSERT (phy);
322  dev->SetPhy (phy);
323  NS_ASSERT (node);
324  phy->SetMobility (node->GetObject<MobilityModel> ());
325  NS_ASSERT (dev);
326  phy->SetDevice (dev);
328  phy->SetChannel (m_channel);
329  dev->SetChannel (m_channel);
330  node->AddDevice (dev);
331  devCont.Add (dev);
332  phy->Start ();
333  index++;
334  }
335  return devCont;
336 }
337 
338 
339 int64_t
341 {
342  m_uniRand->SetStream (streamNum);
343  return 1;
344 }
345 
346 
347 void
349  Density density,
350  double originLatitude,
351  double originLongitude,
352  double maxAltitude,
353  double maxRadius)
354 {
355  NS_LOG_FUNCTION (this);
356  std::list<int> transmitterIndicesToCreate;
357  if (region == REGION_NORTH_AMERICA)
358  {
359  transmitterIndicesToCreate = GenerateRegionalTransmitterIndices
362  density);
363  }
364  else if (region == REGION_EUROPE)
365  {
366  transmitterIndicesToCreate = GenerateRegionalTransmitterIndices
369  density);
370  }
371  else if (region == REGION_JAPAN)
372  {
373  transmitterIndicesToCreate = GenerateRegionalTransmitterIndices
376  density);
377  }
378  std::list<Vector> tvTransmitterLocations =
380  originLongitude,
381  maxAltitude,
382  transmitterIndicesToCreate.size(),
383  maxRadius,
384  m_uniRand);
386  transmitterIndicesToCreate,
387  tvTransmitterLocations);
388 }
389 
390 
391 std::list<int>
393  const int startFrequenciesLength,
394  Density density)
395 {
396  std::vector<double> startFreqVector; //stores all non-zero start frequencies
397  for (int i = 0; i < startFrequenciesLength; i++)
398  {
399  double element = startFrequencies[i];
400  //add all non-zero frequencies to vector (0 means unused channel)
401  if (element != 0) startFreqVector.push_back(element);
402  }
403 
404  //randomly generate number of transmitters to create based on density
405  uint32_t freqVectorSize = startFreqVector.size();
406  int randNumTransmitters = GetRandomNumTransmitters (density, freqVectorSize);
407 
408  //stores start frequencies that transmitters will be created to transmit
409  std::vector<double> transmitterStartFreqsToCreate;
410  for (int i = 0; i < randNumTransmitters; i++)
411  {
412  //get random index from start frequency vector
413  uint32_t randIndex = m_uniRand->GetInteger (0, startFreqVector.size () - 1);
414  //add start frequency corresponding to random index to vector
415  transmitterStartFreqsToCreate.push_back(startFreqVector[randIndex]);
416  //remove selected start frequency from vector so it is not selected again
417  startFreqVector.erase(startFreqVector.begin() + randIndex);
418  }
419 
420  //find indices on startFrequencies[] containing each start frequency that is
421  //selected to be transmitted and add to list
422  std::list<int> transmitterIndicesToCreate;
423  for (int i = 0; i < (int)transmitterStartFreqsToCreate.size(); i++)
424  {
425  for (int channelNumberIndex = 0;
426  channelNumberIndex < startFrequenciesLength; channelNumberIndex++)
427  {
428  if (startFrequencies[channelNumberIndex] == transmitterStartFreqsToCreate[i])
429  {
430  transmitterIndicesToCreate.push_back(channelNumberIndex);
431  break;
432  }
433  }
434  }
435  return transmitterIndicesToCreate;
436 }
437 
438 
439 int
441  uint32_t numChannels)
442 {
443  int numTransmitters;
444  if (density == DENSITY_LOW)
445  {
446  numTransmitters = m_uniRand->GetInteger (1, ceil (0.33 * numChannels));
447  }
448  else if (density == DENSITY_MEDIUM)
449  {
450  numTransmitters = m_uniRand->GetInteger (ceil (0.33 * numChannels) + 1, ceil (0.66 * numChannels));
451  }
452  else
453  {
454  numTransmitters = m_uniRand->GetInteger (ceil (0.66 * numChannels) + 1, numChannels);
455  }
456  return numTransmitters;
457 }
458 
459 
460 void
462  std::list<int> transmitterIndicesToCreate,
463  std::list<Vector> transmitterLocations)
464 {
465  int numTransmitters = (int)transmitterIndicesToCreate.size();
466  for (int transNum = 0; transNum < numTransmitters; transNum++)
467  {
468  Ptr<ListPositionAllocator> nodePosition = CreateObject<ListPositionAllocator> ();
469  // add generated coordinate point to node position
470  nodePosition->Add (transmitterLocations.front());
472  mobility.SetPositionAllocator (nodePosition);
473  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
474  NodeContainer tvNode; // contains position of transmitter to be created
475  tvNode.Create (1);
476  mobility.Install (tvNode);
477  // set channel number for this transmitter
478  uint16_t channelNumber = (uint16_t) transmitterIndicesToCreate.front();
479  Install (tvNode, region, channelNumber); //install tv transmitter
480  transmitterLocations.pop_front(); // remove created transmitter location
481  transmitterIndicesToCreate.pop_front(); // remove created transmitter index
482  }
483 }
484 
485 } // namespace ns3
486 
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition: net-device-container.h:42
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
ns3::TvSpectrumTransmitterHelper::InstallRandomRegionalTransmitters
void InstallRandomRegionalTransmitters(Region region, std::list< int > transmitterIndicesToCreate, std::list< Vector > transmitterLocations)
Installs each randomly generated regional TV transmitter.
Definition: tv-spectrum-transmitter-helper.cc:461
ns3::TvSpectrumTransmitterHelper::CreateRegionalTvTransmitters
void CreateRegionalTvTransmitters(Region region, Density density, double originLatitude, double originLongitude, double maxAltitude, double maxRadius)
Generates and installs (starts transmission on the spectrum channel) a random number of TV transmitte...
Definition: tv-spectrum-transmitter-helper.cc:348
ns3::europeEndFrequencies
const double europeEndFrequencies[70]
EUROPE end frequencies.
Definition: tv-spectrum-transmitter-helper.cc:71
NS_ASSERT
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
ns3::GeographicPositions::RandCartesianPointsAroundGeographicPoint
static std::list< Vector > RandCartesianPointsAroundGeographicPoint(double originLatitude, double originLongitude, double maxAltitude, int numPoints, double maxDistFromOrigin, Ptr< UniformRandomVariable > uniRand)
Generates uniformly distributed random points (in ECEF Cartesian coordinates) within a given altitude...
Definition: geographic-positions.cc:163
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Object::GetObject
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
ns3::AttributeValue
Hold a value for an Attribute.
Definition: attribute.h:69
ns3::TvSpectrumTransmitterHelper::m_uniRand
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
Definition: tv-spectrum-transmitter-helper.h:324
ns3::TvSpectrumTransmitterHelper::DENSITY_MEDIUM
@ DENSITY_MEDIUM
Definition: tv-spectrum-transmitter-helper.h:89
ns3::TvSpectrumTransmitterHelper::Density
Density
density of location that TV transmitters are being set up in
Definition: tv-spectrum-transmitter-helper.h:87
ns3::UniformRandomVariable::GetInteger
uint32_t GetInteger(uint32_t min, uint32_t max)
Get the next random value, as an unsigned integer in the specified range .
Definition: random-variable-stream.cc:193
ns3::TvSpectrumTransmitterHelper::GenerateRegionalTransmitterIndices
std::list< int > GenerateRegionalTransmitterIndices(const double startFrequencies[], const int startFrequenciesLength, Density density)
Generates random indices of given region frequency array (ignoring indices referring to invalid chann...
Definition: tv-spectrum-transmitter-helper.cc:392
ns3::DoubleValue
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
ns3::NodeContainer::Create
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Definition: node-container.cc:98
ns3::TvSpectrumTransmitterHelper::REGION_EUROPE
@ REGION_EUROPE
Definition: tv-spectrum-transmitter-helper.h:80
ns3::northAmericaStartFrequencies
const double northAmericaStartFrequencies[84]
NORTH AMERICA start frequencies.
Definition: tv-spectrum-transmitter-helper.cc:40
ns3::TvSpectrumTransmitter
SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum ...
Definition: tv-spectrum-transmitter.h:47
ns3::TvSpectrumTransmitterHelper::~TvSpectrumTransmitterHelper
virtual ~TvSpectrumTransmitterHelper()
Destructor.
Definition: tv-spectrum-transmitter-helper.cc:106
ns3::europeStartFrequencies
const double europeStartFrequencies[70]
EUROPE start frequencies.
Definition: tv-spectrum-transmitter-helper.cc:63
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
ns3::UniformRandomVariable
The uniform distribution Random Number Generator (RNG).
Definition: random-variable-stream.h:235
ns3::japanStartFrequencies
const double japanStartFrequencies[63]
JAPAN start frequencies.
Definition: tv-spectrum-transmitter-helper.cc:82
ns3::japanArrayLength
const int japanArrayLength
JAPAN: 63 elements (index 0 - 62); valid channels = 1 - 62.
Definition: tv-spectrum-transmitter-helper.cc:80
ns3::TvSpectrumTransmitterHelper::m_channel
Ptr< SpectrumChannel > m_channel
Pointer to spectrum channel object.
Definition: tv-spectrum-transmitter-helper.h:260
ns3::TvSpectrumTransmitterHelper::SetAttribute
void SetAttribute(std::string name, const AttributeValue &val)
Set attribute for each TvSpectrumTransmitter instance to be created.
Definition: tv-spectrum-transmitter-helper.cc:121
ns3::NodeContainer::Begin
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Definition: node-container.cc:77
ns3::TvSpectrumTransmitterHelper::DENSITY_LOW
@ DENSITY_LOW
Definition: tv-spectrum-transmitter-helper.h:88
ns3::TvSpectrumTransmitterHelper::Install
NetDeviceContainer Install(NodeContainer nodes)
Set up and start the TV Transmitter's transmission on the spectrum channel.
Definition: tv-spectrum-transmitter-helper.cc:128
ns3::Node::AddDevice
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:130
ns3::TvSpectrumTransmitterHelper::Region
Region
geographical region that TV transmitters are being set up in
Definition: tv-spectrum-transmitter-helper.h:77
NS_ASSERT_MSG
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition: assert.h:88
ns3::TvSpectrumTransmitterHelper::AssignStreams
int64_t AssignStreams(int64_t streamNum)
Assigns the stream number for the uniform random number generator to use.
Definition: tv-spectrum-transmitter-helper.cc:340
ns3::europeArrayLength
const int europeArrayLength
EUROPE: 70 elements (index 0 - 69); valid channels = 5 - 12, 21 - 69.
Definition: tv-spectrum-transmitter-helper.cc:61
ns3::DoubleValue::Get
double Get(void) const
Definition: double.cc:35
ns3::TvSpectrumTransmitterHelper::TvSpectrumTransmitterHelper
TvSpectrumTransmitterHelper()
Default constructor.
Definition: tv-spectrum-transmitter-helper.cc:98
ns3::TvSpectrumTransmitterHelper::REGION_JAPAN
@ REGION_JAPAN
Definition: tv-spectrum-transmitter-helper.h:79
ns3::NodeContainer::Iterator
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Definition: node-container.h:42
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition: object-factory.h:223
ns3::TvSpectrumTransmitterHelper::InstallAdjacent
NetDeviceContainer InstallAdjacent(NodeContainer nodes)
Set up and start the TV Transmitter's transmission on the spectrum channel.
Definition: tv-spectrum-transmitter-helper.cc:228
NS_LOG_FUNCTION
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Definition: log-macros-enabled.h:244
ns3::TvSpectrumTransmitterHelper::SetChannel
void SetChannel(Ptr< SpectrumChannel > c)
Set the spectrum channel for the device(s) to transmit on.
Definition: tv-spectrum-transmitter-helper.cc:114
ns3::MobilityModel
Keep track of the current position and velocity of an object.
Definition: mobility-model.h:40
ns3::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
ns3::northAmericaArrayLength
const int northAmericaArrayLength
NORTH AMERICA: 84 elements (index 0 - 83); valid channels = 2 - 83.
Definition: tv-spectrum-transmitter-helper.cc:38
ns3::NodeContainer::End
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Definition: node-container.cc:82
ns3::RandomVariableStream::SetStream
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
Definition: random-variable-stream.cc:100
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition: object-factory.cc:40
tv-spectrum-transmitter-helper.h
ns3::ObjectFactory::Create
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Definition: object-factory.cc:98
ns3::TvSpectrumTransmitterHelper::GetRandomNumTransmitters
int GetRandomNumTransmitters(Density density, uint32_t numChannels)
Randomly generates the number of TV transmitters to be created based on given density and number of p...
Definition: tv-spectrum-transmitter-helper.cc:440
ns3::TvSpectrumTransmitterHelper::m_factory
ObjectFactory m_factory
Object factory for attribute setting.
Definition: tv-spectrum-transmitter-helper.h:323
ns3::TvSpectrumTransmitterHelper::REGION_NORTH_AMERICA
@ REGION_NORTH_AMERICA
Definition: tv-spectrum-transmitter-helper.h:78
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition: object.h:576
ns3::northAmericaEndFrequencies
const double northAmericaEndFrequencies[84]
NORTH AMERICA end frequencies.
Definition: tv-spectrum-transmitter-helper.cc:50
ns3::NetDeviceContainer::Add
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Definition: net-device-container.cc:67
ns3::MobilityHelper
Helper class used to assign positions and mobility models to nodes.
Definition: mobility-helper.h:43
third.mobility
mobility
Definition: third.py:108
third.phy
phy
Definition: third.py:93
ns3::japanEndFrequencies
const double japanEndFrequencies[63]
JAPAN end frequencies.
Definition: tv-spectrum-transmitter-helper.cc:90