UAN configuration helper. More...
#include "uan-helper.h"
Public Member Functions | |
UanHelper () | |
Default constructor. | |
virtual | ~UanHelper () |
Destructor. | |
int64_t | AssignStreams (NetDeviceContainer c, int64_t stream) |
Assign a fixed random variable stream number to the random variables used by this model. | |
NetDeviceContainer | Install (NodeContainer c) const |
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPropModelIdeal) and creates, for each of the input nodes, a new ns3::UanNetDevice attached to this shared channel. | |
NetDeviceContainer | Install (NodeContainer c, Ptr< UanChannel > channel) const |
For each of the input nodes, a new ns3::UanNetDevice is attached to the shared input channel. | |
Ptr< UanNetDevice > | Install (Ptr< Node > node, Ptr< UanChannel > channel) const |
Create a default an stack. | |
template<typename... Ts> | |
void | SetMac (std::string type, Ts &&... args) |
Set MAC attributes. | |
template<typename... Ts> | |
void | SetPhy (std::string phyType, Ts &&... args) |
Set PHY attributes. | |
template<typename... Ts> | |
void | SetTransducer (std::string type, Ts &&... args) |
Set the transducer attributes. | |
Static Public Member Functions | |
static void | EnableAscii (std::ostream &os, NetDeviceContainer d) |
Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in the input device container and dump that to the specified stdc++ output stream. | |
static void | EnableAscii (std::ostream &os, NodeContainer n) |
Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in one of the input node and dump that to the specified stdc++ output stream. | |
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::UanNetDevice and dump that to the specified stdc++ output stream. | |
static void | EnableAsciiAll (std::ostream &os) |
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specified stdc++ output stream. | |
Private Attributes | |
ObjectFactory | m_device |
The device. | |
ObjectFactory | m_mac |
The MAC layer. | |
ObjectFactory | m_phy |
The PHY layer. | |
ObjectFactory | m_transducer |
The transducer. | |
UAN configuration helper.
Definition at line 30 of file uan-helper.h.
ns3::UanHelper::UanHelper | ( | ) |
Default constructor.
Definition at line 76 of file uan-helper.cc.
References m_mac, m_phy, m_transducer, and ns3::ObjectFactory::SetTypeId().
|
virtual |
Destructor.
Definition at line 83 of file uan-helper.cc.
int64_t ns3::UanHelper::AssignStreams | ( | NetDeviceContainer | c, |
int64_t | stream ) |
Assign a fixed random variable stream number to the random variables used by this model.
Return the number of streams (possibly zero) that have been assigned. The Install() method should have previously been called by the user.
c | NetDeviceContainer of the set of net devices for which the UanNetDevice should be modified to use a fixed stream. |
stream | First stream index to use. |
Definition at line 181 of file uan-helper.cc.
References ns3::NetDeviceContainer::Begin(), ns3::DynamicCast(), and ns3::NetDeviceContainer::End().
|
static |
Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in the input device container and dump that to the specified stdc++ output stream.
os | Output stream. |
d | Device container. |
Definition at line 103 of file uan-helper.cc.
References ns3::NetDeviceContainer::Begin(), EnableAscii(), and ns3::NetDeviceContainer::End().
|
static |
Enable ascii output on each device which is of the ns3::UanNetDevice type and which is located in one of the input node and dump that to the specified stdc++ output stream.
os | Output stream. |
n | Node container. |
Definition at line 113 of file uan-helper.cc.
References ns3::NetDeviceContainer::Add(), ns3::NodeContainer::Begin(), EnableAscii(), and ns3::NodeContainer::End().
Enable ascii output on the specified deviceid within the specified nodeid if it is of type ns3::UanNetDevice and dump that to the specified stdc++ output stream.
os | Output stream. |
nodeid | The id of the node to generate ascii output for. |
deviceid | The id of the device to generate ascii output for. |
Definition at line 88 of file uan-helper.cc.
References ns3::AsciiPhyRxOkEvent(), ns3::AsciiPhyTxEvent(), ns3::Config::Connect(), ns3::Packet::EnablePrinting(), and ns3::MakeBoundCallback().
Referenced by EnableAscii(), EnableAscii(), and EnableAsciiAll().
|
static |
Enable ascii output on each device which is of the ns3::UanNetDevice type and dump that to the specified stdc++ output stream.
os | Output stream. |
Definition at line 128 of file uan-helper.cc.
References EnableAscii(), and ns3::NodeContainer::GetGlobal().
Referenced by Experiment::Run().
NetDeviceContainer ns3::UanHelper::Install | ( | NodeContainer | c | ) | const |
This method creates a simple ns3::UanChannel (with a default ns3::UanNoiseModelDefault and ns3::UanPropModelIdeal) and creates, for each of the input nodes, a new ns3::UanNetDevice attached to this shared channel.
Each ns3::UanNetDevice is also configured with an ns3::UanTransducerHd, ns3::UanMac, and, ns3::UanPhy, all of which are created based on the user-specified attributes specified in UanHelper::SetTransducer, UanHelper::SetMac, and, UanHelper::SetPhy.
c | A set of nodes. |
Definition at line 134 of file uan-helper.cc.
References ns3::CreateObject(), and Install().
Referenced by AcousticModemEnergyDepletionTestCase::DoRun(), AcousticModemEnergyTestCase::DoRun(), Install(), Install(), Experiment::Run(), Experiment::Run(), NetAnimExperiment::Run(), and UanExperiment::SetupCommunications().
NetDeviceContainer ns3::UanHelper::Install | ( | NodeContainer | c, |
Ptr< UanChannel > | channel ) const |
For each of the input nodes, a new ns3::UanNetDevice is attached to the shared input channel.
Each ns3::UanNetDevice is also configured with an ns3::UanTransducerHd, a ns3::UanMac, and ns3::UanPhy, all of which are created based on the user-specified attributes specified in UanHelper::SetTransducer, UanHelper::SetMac, and UanHelper::SetPhy.
c | A set of nodes. |
channel | A channel to use. |
Definition at line 145 of file uan-helper.cc.
References ns3::NodeContainer::Begin(), ns3::NodeContainer::End(), Install(), and NS_LOG_DEBUG.
Ptr< UanNetDevice > ns3::UanHelper::Install | ( | Ptr< Node > | node, |
Ptr< UanChannel > | channel ) const |
Create a default an stack.
The stack includes:
Channel, physical layer, transducer and mac layer are added to the UanNetDevice and then added to the node.
node | A node where to install the uan components. |
channel | A channel to use. |
Definition at line 161 of file uan-helper.cc.
References ns3::Mac8Address::Allocate(), ns3::ObjectFactory::Create(), ns3::CreateObject(), m_mac, m_phy, and m_transducer.
void ns3::UanHelper::SetMac | ( | std::string | type, |
Ts &&... | args ) |
Set MAC attributes.
Ts | [deduced] Argument types |
type | The type of ns3::UanMac to create. | |
[in] | args | Name and AttributeValue pairs to set. |
All the attributes specified in this method should exist in the requested mac.
Definition at line 186 of file uan-helper.h.
References m_mac.
Referenced by Experiment::Run(), Experiment::Run(), and NetAnimExperiment::Run().
void ns3::UanHelper::SetPhy | ( | std::string | phyType, |
Ts &&... | args ) |
Set PHY attributes.
Ts | [deduced] Argument types |
phyType | The type of ns3::UanPhy to create. | |
[in] | args | Name and AttributeValue pairs to set. |
All the attributes specified in this method should exist in the requested Phy.
Definition at line 193 of file uan-helper.h.
References m_phy.
Referenced by Experiment::Run().
void ns3::UanHelper::SetTransducer | ( | std::string | type, |
Ts &&... | args ) |
Set the transducer attributes.
Ts | [deduced] Argument types |
type | The type of ns3::Transducer to create. | |
[in] | args | Name and AttributeValue pairs to set. |
All the attributes specified in this method should exist in the requested transducer.
Definition at line 200 of file uan-helper.h.
References m_transducer.
|
private |
The device.
Definition at line 174 of file uan-helper.h.
|
private |
The MAC layer.
Definition at line 175 of file uan-helper.h.
Referenced by UanHelper(), Install(), and SetMac().
|
private |
The PHY layer.
Definition at line 176 of file uan-helper.h.
Referenced by UanHelper(), Install(), and SetPhy().
|
private |
The transducer.
Definition at line 177 of file uan-helper.h.
Referenced by UanHelper(), Install(), and SetTransducer().