20 #include "ns3/propagation-delay-model.h" 21 #include "ns3/spectrum-propagation-loss-model.h" 22 #include "ns3/mobility-model.h" 24 #include "ns3/config.h" 25 #include "ns3/simulator.h" 26 #include "ns3/names.h" 27 #include "ns3/antenna-model.h" 28 #include "ns3/spectrum-channel.h" 29 #include "ns3/spectrum-analyzer.h" 30 #include "ns3/non-communicating-net-device.h" 31 #include "ns3/output-stream-wrapper.h" 32 #include "ns3/trace-helper.h" 53 std::ostream* ostream = streamWrapper->
GetStream ();
68 *ostream << std::endl;
131 factory.
Set (n0, v0);
132 factory.
Set (n1, v1);
133 factory.
Set (n2, v2);
134 factory.
Set (n3, v3);
135 factory.
Set (n4, v4);
136 factory.
Set (n5, v5);
137 factory.
Set (n6, v6);
138 factory.
Set (n7, v7);
179 phy->SetDevice (dev);
190 NS_ASSERT_MSG (antenna,
"error in creating the AntennaModel object");
191 phy->SetAntenna (antenna);
198 NS_LOG_LOGIC (
"creating new output stream and binding it to the callback");
200 std::string filename;
207 std::ostringstream oss;
209 oss <<
"/NodeList/" << node->
GetId () <<
"/DeviceList/" << devId <<
"/$ns3::NonCommunicatingNetDevice/Phy/AveragePowerSpectralDensityReport";
230 Ptr<Node> node = Names::Find<Node> (nodeName);
Manage ASCII trace files for device models.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint32_t GetId(void) const
void SetAntenna(std::string type, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
Hold a value for an Attribute.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Ptr< OutputStreamWrapper > CreateFileStream(std::string filename, std::ios::openmode filemode=std::ios::out)
Create and initialize an output stream object we'll use to write the traced bits. ...
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
This class implements a device which does not communicate, in the sense that it does not interact wit...
std::string GetFilenameFromDevice(std::string prefix, Ptr< NetDevice > device, bool useObjectNames=true)
Let the ascii trace helper figure out a reasonable filename to use for an ascii trace file associated...
ObjectFactory m_device
Object factory for the NetDevice objects.
Values::const_iterator ConstValuesBegin() const
Keep track of the current position and velocity of an object.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
Ptr< SpectrumModel > m_rxSpectrumModel
Spectrum model.
ObjectFactory m_phy
Object factory for the phy objects.
std::string m_prefix
Prefix for the output files.
holds a vector of ns3::NetDevice pointers
void ConnectWithoutContext(std::string path, const CallbackBase &cb)
~SpectrumAnalyzerHelper()
void SetPhyAttribute(std::string name, const AttributeValue &v)
NetDeviceContainer Install(NodeContainer c) const
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Simple SpectrumPhy implementation that averages the spectrum power density of incoming transmissions ...
Ptr< SpectrumChannel > m_channel
Channel.
Values::const_iterator ConstValuesEnd() const
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
ObjectFactory m_antenna
Object factory for the Antenna objects.
Instantiate subclasses of ns3::Object.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
void SetChannel(Ptr< SpectrumChannel > channel)
Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper...
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals...
void EnableAsciiAll(std::string prefix)
Enable ASCII output.
Bands::const_iterator ConstBandsEnd() const
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
std::ostream * GetStream(void)
Return a pointer to an ostream previously set in the wrapper.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Bands::const_iterator ConstBandsBegin() const
static void WriteAveragePowerSpectralDensityReport(Ptr< OutputStreamWrapper > streamWrapper, Ptr< const SpectrumValue > avgPowerSpectralDensity)
Writes a report of the Average Power Spectral Density.