A Discrete-Event Network Simulator
API
tv-spectrum-transmitter-helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 University of Washington
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Benjamin Cizdziel <ben.cizdziel@gmail.com>
18  */
19 
20 #ifndef TV_SPECTRUM_TRANSMITTER_HELPER_H
21 #define TV_SPECTRUM_TRANSMITTER_HELPER_H
22 
23 #include "ns3/object-factory.h"
24 #include <ns3/antenna-model.h>
25 #include <ns3/mobility-model.h>
26 #include <ns3/net-device-container.h>
27 #include <ns3/net-device.h>
28 #include <ns3/node-container.h>
29 #include <ns3/non-communicating-net-device.h>
30 #include <ns3/random-variable-stream.h>
31 #include <ns3/spectrum-channel.h>
32 #include <ns3/spectrum-phy.h>
33 #include <ns3/spectrum-signal-parameters.h>
34 #include <ns3/spectrum-value.h>
35 #include <ns3/tv-spectrum-transmitter.h>
36 
38 
39 namespace ns3
40 {
41 
67 {
68  public:
69  friend class ::TvHelperDistributionTestCase;
70 
74  enum Region
75  {
79  };
80 
84  enum Density
85  {
89  };
90 
93 
100 
107  void SetAttribute(std::string name, const AttributeValue& val);
108 
125 
146  NetDeviceContainer Install(NodeContainer nodes, Region region, uint16_t channelNumber);
147 
173 
201  NetDeviceContainer InstallAdjacent(NodeContainer nodes, Region region, uint16_t channelNumber);
202 
209  int64_t AssignStreams(int64_t streamNum);
210 
246  Density density,
247  double originLatitude,
248  double originLongitude,
249  double maxAltitude,
250  double maxRadius);
251 
252  private:
254 
272  std::list<int> GenerateRegionalTransmitterIndices(const double startFrequencies[],
273  const int startFrequenciesLength,
274  Density density);
275 
299  int GetRandomNumTransmitters(Density density, uint32_t numChannels);
300 
313  std::list<int> transmitterIndicesToCreate,
314  std::list<Vector> transmitterLocations);
315 
318 };
319 
320 } // namespace ns3
321 
322 #endif /* TV_SPECTRUM_TRANSMITTER_HELPER_H */
This test verifies the accuracy of the private GetRandomNumTransmitters() method in the TvSpectrumTra...
Hold a value for an Attribute.
Definition: attribute.h:70
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
Helper class which uses TvSpectrumTransmitter class to create customizable TV transmitter(s) that tra...
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 SetChannel(Ptr< SpectrumChannel > c)
Set the spectrum channel for the device(s) to transmit on.
NetDeviceContainer InstallAdjacent(NodeContainer nodes)
Set up and start the TV Transmitter's transmission on the spectrum channel.
Density
density of location that TV transmitters are being set up in
void InstallRandomRegionalTransmitters(Region region, std::list< int > transmitterIndicesToCreate, std::list< Vector > transmitterLocations)
Installs each randomly generated regional TV transmitter.
Region
geographical region that TV transmitters are being set up in
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...
Ptr< UniformRandomVariable > m_uniRand
Object to generate uniform random numbers.
int64_t AssignStreams(int64_t streamNum)
Assigns the stream number for the uniform random number generator to use.
ObjectFactory m_factory
Object factory for attribute setting.
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...
void SetAttribute(std::string name, const AttributeValue &val)
Set attribute for each TvSpectrumTransmitter instance to be created.
NetDeviceContainer Install(NodeContainer nodes)
Set up and start the TV Transmitter's transmission on the spectrum channel.
Ptr< SpectrumChannel > m_channel
Pointer to spectrum channel object.
NodeContainer nodes
Every class exported by the ns3 library is enclosed in the ns3 namespace.