A Discrete-Event Network Simulator
API
tv-spectrum-transmitter-helper.h
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 #ifndef TV_SPECTRUM_TRANSMITTER_HELPER_H
22 #define TV_SPECTRUM_TRANSMITTER_HELPER_H
23 
24 #include <ns3/spectrum-value.h>
25 #include <ns3/spectrum-phy.h>
26 #include <ns3/spectrum-channel.h>
27 #include <ns3/antenna-model.h>
28 #include <ns3/spectrum-signal-parameters.h>
29 #include <ns3/mobility-model.h>
30 #include <ns3/net-device.h>
31 #include <ns3/net-device-container.h>
32 #include <ns3/node-container.h>
33 #include <ns3/non-communicating-net-device.h>
34 #include <ns3/random-variable-stream.h>
35 #include <ns3/tv-spectrum-transmitter.h>
36 #include "ns3/object-factory.h"
37 
39 
40 namespace ns3
41 {
42 
68 {
69 
70 public:
71  friend class ::TvHelperDistributionTestCase;
72 
76  enum Region
77  {
81  };
82 
86  enum Density
87  {
91  };
92 
94  virtual ~TvSpectrumTransmitterHelper ();
95 
102 
109  void SetAttribute (std::string name, const AttributeValue &val);
110 
127 
149  Region region,
150  uint16_t channelNumber);
151 
177 
206  Region region,
207  uint16_t channelNumber);
208 
215  int64_t AssignStreams (int64_t streamNum);
216 
251  void CreateRegionalTvTransmitters (Region region,
252  Density density,
253  double originLatitude,
254  double originLongitude,
255  double maxAltitude,
256  double maxRadius);
257 
258 
259 private:
261 
279  std::list<int> GenerateRegionalTransmitterIndices (const double startFrequencies[],
280  const int startFrequenciesLength,
281  Density density);
282 
306  int GetRandomNumTransmitters (Density density, uint32_t numChannels);
307 
320  std::list<int> transmitterIndicesToCreate,
321  std::list<Vector> transmitterLocations);
322 
325 
326 };
327 
328 } // namespace ns3
329 
330 #endif /* TV_SPECTRUM_TRANSMITTER_HELPER_H */
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition: net-device-container.h:42
ns3::TvSpectrumTransmitterHelper::DENSITY_HIGH
@ DENSITY_HIGH
Definition: tv-spectrum-transmitter-helper.h:90
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
TvHelperDistributionTestCase
Definition: tv-helper-distribution-test.cc:49
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::TvSpectrumTransmitterHelper
Helper class which uses TvSpectrumTransmitter class to create customizable TV transmitter(s) that tra...
Definition: tv-spectrum-transmitter-helper.h:68
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::TvSpectrumTransmitterHelper::REGION_EUROPE
@ REGION_EUROPE
Definition: tv-spectrum-transmitter-helper.h:80
first.nodes
nodes
Definition: first.py:32
ns3::TvSpectrumTransmitterHelper::~TvSpectrumTransmitterHelper
virtual ~TvSpectrumTransmitterHelper()
Destructor.
Definition: tv-spectrum-transmitter-helper.cc:106
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
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::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition: object-factory.h:48
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::TvSpectrumTransmitterHelper::Region
Region
geographical region that TV transmitters are being set up in
Definition: tv-spectrum-transmitter-helper.h:77
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::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::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
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::NodeContainer
keep track of a set of node pointers.
Definition: node-container.h:39
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