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 
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
void SetStream(int64_t stream)
Specifies the stream number for the RngStream.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
ObjectFactory m_factory
Object factory for attribute setting.
Hold a value for an Attribute.
Definition: attribute.h:68
Region
geographical region that TV transmitters are being set up in
#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
const double europeEndFrequencies[70]
EUROPE end frequencies.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:204
const double northAmericaStartFrequencies[84]
NORTH AMERICA start frequencies.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
const double europeStartFrequencies[70]
EUROPE start frequencies.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
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...
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...
mobility
Definition: third.py:108
phy
Definition: third.py:93
Keep track of the current position and velocity of an object.
virtual uint32_t GetInteger(void)=0
Get the next random value as an integer drawn from the distribution.
NetDeviceContainer Install(NodeContainer nodes)
Set up and start the TV Transmitter&#39;s transmission on the spectrum channel.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
const int japanArrayLength
JAPAN: 63 elements (index 0 - 62); valid channels = 1 - 62.
const int northAmericaArrayLength
NORTH AMERICA: 84 elements (index 0 - 83); valid channels = 2 - 83.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
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...
holds a vector of ns3::NetDevice pointers
Ptr< SpectrumChannel > m_channel
Pointer to spectrum channel object.
The uniform distribution Random Number Generator (RNG).
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:459
double Get(void) const
Definition: double.cc:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
const double northAmericaEndFrequencies[84]
NORTH AMERICA end frequencies.
const double japanStartFrequencies[63]
JAPAN start frequencies.
int64_t AssignStreams(int64_t streamNum)
Assigns the stream number for the uniform random number generator to use.
SpectrumPhy implementation that creates a customizable TV transmitter which transmits a PSD spectrum ...
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
NetDeviceContainer InstallAdjacent(NodeContainer nodes)
Set up and start the TV Transmitter&#39;s transmission on the spectrum channel.
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...
Helper class used to assign positions and mobility models to nodes.
void InstallRandomRegionalTransmitters(Region region, std::list< int > transmitterIndicesToCreate, std::list< Vector > transmitterLocations)
Installs each randomly generated regional TV transmitter.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Definition: node.cc:128
Density
density of location that TV transmitters are being set up in
const double japanEndFrequencies[63]
JAPAN end frequencies.
Ptr< T > CreateObject(void)
Create an object by type, with varying number of constructor parameters.
Definition: object.h:528
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
const int europeArrayLength
EUROPE: 70 elements (index 0 - 69); valid channels = 5 - 12, 21 - 69.
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
void SetAttribute(std::string name, const AttributeValue &val)
Set attribute for each TvSpectrumTransmitter instance to be created.
void SetChannel(Ptr< SpectrumChannel > c)
Set the spectrum channel for the device(s) to transmit on.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.