16#include "ns3/config.h"
18#include "ns3/mobility-model.h"
19#include "ns3/simulator.h"
20#include "ns3/uan-channel.h"
21#include "ns3/uan-mac.h"
22#include "ns3/uan-net-device.h"
23#include "ns3/uan-noise-model-default.h"
24#include "ns3/uan-phy.h"
25#include "ns3/uan-prop-model-ideal.h"
26#include "ns3/uan-prop-model.h"
27#include "ns3/uan-transducer.h"
28#include "ns3/uan-tx-mode.h"
51 double txPowerDb [[maybe_unused]],
70 double snr [[maybe_unused]],
91 std::ostringstream oss;
93 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/RxOk";
98 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/Tx";
105 for (
auto i = d.
Begin(); i != d.
End(); ++i)
108 EnableAscii(os, dev->GetNode()->GetId(), dev->GetIfIndex());
116 for (
auto i = n.
Begin(); i != n.
End(); ++i)
119 for (
uint32_t j = 0; j < node->GetNDevices(); ++j)
121 devs.
Add(node->GetDevice(j));
139 channel->SetNoiseModel(noise);
148 for (
auto i = c.
Begin(); i != c.
End(); i++)
172 device->SetTransducer(trans);
173 device->SetChannel(channel);
175 node->AddDevice(device);
183 int64_t currentStream = stream;
185 for (
auto i = c.
Begin(); i != c.
End(); ++i)
191 currentStream += uan->GetPhy()->AssignStreams(currentStream);
192 currentStream += uan->GetMac()->AssignStreams(currentStream);
195 return (currentStream - stream);
static Mac8Address Allocate()
Allocates Mac8Address from 0-254.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
static NodeContainer GetGlobal()
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
static void EnablePrinting()
Enable printing packets metadata.
Smart pointer class similar to boost::intrusive_ptr.
static Time Now()
Return the current simulation virtual time.
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
ObjectFactory m_phy
The PHY layer.
ObjectFactory m_transducer
The transducer.
static void EnableAscii(std::ostream &os, uint32_t nodeid, uint32_t deviceid)
Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNe...
ObjectFactory m_mac
The MAC layer.
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
static void EnableAsciiAll(std::ostream &os)
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specif...
UanHelper()
Default constructor.
virtual ~UanHelper()
Destructor.
Virtual base class for all UAN MAC protocols.
Base class for UAN Phy models.
Virtual base for Transducer objects.
Abstraction of packet modulation information.
void Connect(std::string path, const CallbackBase &cb)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static void AsciiPhyRxOkEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, double snr, UanTxMode mode)
Ascii trace callback on successful packet reception.
Ptr< T1 > DynamicCast(const Ptr< T2 > &p)
Cast a Ptr.
static void AsciiPhyTxEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, double txPowerDb, UanTxMode mode)
Ascii trace callback on Phy transmit events.