27 #include "ns3/uan-net-device.h"
28 #include "ns3/uan-mac.h"
29 #include "ns3/uan-phy.h"
30 #include "ns3/uan-channel.h"
31 #include "ns3/uan-prop-model.h"
32 #include "ns3/uan-prop-model-ideal.h"
33 #include "ns3/uan-transducer.h"
34 #include "ns3/mobility-model.h"
36 #include "ns3/uan-tx-mode.h"
37 #include "ns3/config.h"
38 #include "ns3/simulator.h"
39 #include "ns3/uan-noise-model-default.h"
167 std::ostringstream oss;
169 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/RxOk";
174 oss <<
"/NodeList/" << nodeid <<
"/DeviceList/" << deviceid <<
"/$ns3::UanNetDevice/Phy/Tx";
184 EnableAscii (os, dev->GetNode ()->GetId (), dev->GetIfIndex ());
195 for (uint32_t j = 0; j < node->
GetNDevices (); ++j)
214 channel->SetPropagationModel (CreateObject<UanPropModelIdeal> ());
215 channel->SetNoiseModel (noise);
230 devices.
Add (device);
246 device->SetMac (mac);
247 device->SetPhy (phy);
248 device->SetTransducer (trans);
249 device->SetChannel (channel);
259 int64_t currentStream = stream;
267 currentStream += uan->GetPhy ()->AssignStreams (currentStream);
268 currentStream += uan->GetMac ()->AssignStreams (currentStream);
271 return (currentStream - stream);
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
virtual ~UanHelper()
Destructor.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold a value for an Attribute.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
UanHelper()
Defalt constructor.
#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.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
Keep track of the current position and velocity of an object.
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
ObjectFactory m_transducer
The transducer.
Virtual base class for all UAN MAC protocols.
static void EnablePrinting(void)
Enable printing packets metadata.
void SetMac(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())
Set MAC attributes.
void SetTransducer(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())
Set the transducer attributes.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
ObjectFactory m_mac
The MAC layer.
Abstraction of packet modulation information.
holds a vector of ns3::NetDevice pointers
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Virtual base for Transducer objects.
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...
void Connect(std::string path, const CallbackBase &cb)
static void AsciiPhyRxOkEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, double snr, UanTxMode mode)
Ascii trace callback on successful packet reception.
uint32_t GetNDevices(void) const
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
static Time Now(void)
Return the current simulation virtual time.
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...
Base class for UAN Phy models.
static NodeContainer GetGlobal(void)
Create a NodeContainer that contains a list of all nodes created through NodeContainer::Create() and ...
static void AsciiPhyTxEvent(std::ostream *os, std::string context, Ptr< const Packet > packet, double txPowerDb, UanTxMode mode)
Ascii trace callback on Phy transmit events.
Instantiate subclasses of ns3::Object.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
static UanAddress Allocate()
Allocates UanAddress from 0-254.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
NetDeviceContainer Install(NodeContainer c) const
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPr...
ObjectFactory m_phy
The PHY layer.
void SetPhy(std::string phyType, 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())
Set PHY attributes.