A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
anonymous_namespace{uan-rc-example.cc}::Experiment Class Reference

Container for the parameters describing a single experiment. More...

Collaboration diagram for anonymous_namespace{uan-rc-example.cc}::Experiment:

Public Member Functions

 Experiment ()
 Default constructor.
void CreateDualModes (uint32_t fc)
 Create m_numRates matching control and data modes.
UanTxMode CreateMode (uint32_t kass, uint32_t fc, bool upperblock, std::string name) const
 Create a UanTxMode.
void ReceivePacket (Ptr< Socket > socket)
 Callback to receive a packet.
uint32_t Run (uint32_t param)
 Run a parametrized experiment.

Public Attributes

uint32_t m_bytesTotal
 Total number of bytes received in a simulation run.
UanModesList m_controlModes
 List of UanTxModes used for control channels.
UanModesList m_dataModes
 List of UanTxModes used for data channels.
bool m_doNode
 1 for do max nodes simulation (invalidates AMin and AMax values).
std::string m_gnuplotfile
 Filename for GnuPlot.
uint32_t m_maxRange
 Maximum range between gateway and acoustic node.
uint32_t m_numNodes
 Number of nodes (invalid for m_doNode true).
uint32_t m_numRates
 Number of divided rates ( (NumberRates+1)TotalRate should be 0).
uint32_t m_pktSize
 Packet size in bytes.
Time m_sifs
 SIFS time duration.
uint32_t m_simMax
 Maximum parameter to test.
uint32_t m_simMin
 Minimum parameter to test.
uint32_t m_simStep
 Amount to increment param per trial.
Time m_simTime
 Simulation time per trial.
uint32_t m_totalRate
 Total channel capacity.

Detailed Description

Container for the parameters describing a single experiment.

An experiment samples a range of parameter values. The parameter controls the number of nodes (if m_doNode is true), or the UanMacRcGw MaxReservations attribute.

See also
uan-rc-example.cc

Definition at line 75 of file uan-rc-example.cc.

Constructor & Destructor Documentation

◆ Experiment()

anonymous_namespace{uan-rc-example.cc}::Experiment::Experiment ( )

Default constructor.

Definition at line 147 of file uan-rc-example.cc.

References m_bytesTotal, m_doNode, m_gnuplotfile, m_maxRange, m_numNodes, m_numRates, m_pktSize, m_sifs, m_simMax, m_simMin, m_simStep, m_simTime, m_totalRate, and ns3::Seconds().

Here is the call graph for this function:

Member Function Documentation

◆ CreateDualModes()

void anonymous_namespace{uan-rc-example.cc}::Experiment::CreateDualModes ( uint32_t fc)

Create m_numRates matching control and data modes.

Parameters
fcMode center frequency offset.

Definition at line 202 of file uan-rc-example.cc.

References CreateMode(), m_controlModes, m_dataModes, and m_numRates.

Here is the call graph for this function:

◆ CreateMode()

UanTxMode anonymous_namespace{uan-rc-example.cc}::Experiment::CreateMode ( uint32_t kass,
uint32_t fc,
bool upperblock,
std::string name ) const

Create a UanTxMode.

The mode physical rate is set equal to m_totalRate. The data rate and bandwidth are set to

\‍[{\rm{rate, bandwidth}} = {\rm{kass}}\frac{{{\rm{m\_totalRate}}}}{{{\rm{m\_numRates}} +
1}}\‍]

The center frequency is set to

\‍[{f_{center}} = {\rm{fc}} + \frac{{ \pm {\rm{m\_totalRate}} \mp {\rm{rate}}}}{2}\‍]

where the upper sign is taken if upperblock is true.

Parameters
kassFraction of total bandwidth assigned to mode.
fcMode center frequency offset.
upperblockSign choice in setting the center frequency.
nameMode name.
Returns
The new mode.

Definition at line 175 of file uan-rc-example.cc.

References ns3::UanTxModeFactory::CreateMode(), m_numRates, m_totalRate, and ns3::UanTxMode::OTHER.

Referenced by CreateDualModes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReceivePacket()

void anonymous_namespace{uan-rc-example.cc}::Experiment::ReceivePacket ( Ptr< Socket > socket)

Callback to receive a packet.

Parameters
socketThe socket receiving packets.

Definition at line 165 of file uan-rc-example.cc.

References m_bytesTotal.

Referenced by Run().

Here is the caller graph for this function:

◆ Run()

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::Run ( uint32_t param)

Run a parametrized experiment.

The parameter sets either the number of nodes (if m_doNode is true) or the "a" parameter, which controls the UanMacRcGw MaxReservations attribute.

Parameters
paramThe parameter value.
Returns
The total number of bytes delivered.

Definition at line 215 of file uan-rc-example.cc.

References ns3::CreateObject(), ns3::Socket::CreateSocket(), ns3::Simulator::Destroy(), ns3::NetDeviceContainer::Get(), ns3::PacketSocketHelper::Install(), ns3::UanHelper::Install(), ns3::TypeId::LookupByName(), m_bytesTotal, m_controlModes, m_dataModes, m_doNode, m_maxRange, m_numNodes, m_numRates, m_pktSize, m_sifs, m_simTime, m_totalRate, ns3::MakeCallback(), nodes, r, ReceivePacket(), ns3::Simulator::Run(), ns3::Seconds(), ns3::UanHelper::SetMac(), ns3::UanHelper::SetPhy(), ns3::PacketSocketAddress::SetPhysicalAddress(), ns3::PacketSocketAddress::SetProtocol(), ns3::PacketSocketAddress::SetSingleDevice(), sink, ns3::ApplicationContainer::Start(), ns3::ApplicationContainer::Stop(), ns3::Simulator::Stop(), and x.

Here is the call graph for this function:

Member Data Documentation

◆ m_bytesTotal

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_bytesTotal

Total number of bytes received in a simulation run.

Definition at line 92 of file uan-rc-example.cc.

Referenced by Experiment(), ReceivePacket(), and Run().

◆ m_controlModes

UanModesList anonymous_namespace{uan-rc-example.cc}::Experiment::m_controlModes

List of UanTxModes used for control channels.

Definition at line 95 of file uan-rc-example.cc.

Referenced by CreateDualModes(), and Run().

◆ m_dataModes

UanModesList anonymous_namespace{uan-rc-example.cc}::Experiment::m_dataModes

List of UanTxModes used for data channels.

Definition at line 94 of file uan-rc-example.cc.

Referenced by CreateDualModes(), and Run().

◆ m_doNode

bool anonymous_namespace{uan-rc-example.cc}::Experiment::m_doNode

1 for do max nodes simulation (invalidates AMin and AMax values).

Definition at line 86 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_gnuplotfile

std::string anonymous_namespace{uan-rc-example.cc}::Experiment::m_gnuplotfile

Filename for GnuPlot.

Definition at line 90 of file uan-rc-example.cc.

Referenced by Experiment().

◆ m_maxRange

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_maxRange

Maximum range between gateway and acoustic node.

Definition at line 83 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_numNodes

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_numNodes

Number of nodes (invalid for m_doNode true).

Definition at line 84 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_numRates

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_numRates

Number of divided rates ( (NumberRates+1)TotalRate should be 0).

Definition at line 81 of file uan-rc-example.cc.

Referenced by Experiment(), CreateDualModes(), CreateMode(), and Run().

◆ m_pktSize

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_pktSize

Packet size in bytes.

Definition at line 85 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_sifs

Time anonymous_namespace{uan-rc-example.cc}::Experiment::m_sifs

SIFS time duration.

Definition at line 87 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_simMax

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_simMax

Maximum parameter to test.

Definition at line 79 of file uan-rc-example.cc.

Referenced by Experiment().

◆ m_simMin

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_simMin

Minimum parameter to test.

Definition at line 78 of file uan-rc-example.cc.

Referenced by Experiment().

◆ m_simStep

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_simStep

Amount to increment param per trial.

Definition at line 80 of file uan-rc-example.cc.

Referenced by Experiment().

◆ m_simTime

Time anonymous_namespace{uan-rc-example.cc}::Experiment::m_simTime

Simulation time per trial.

Definition at line 88 of file uan-rc-example.cc.

Referenced by Experiment(), and Run().

◆ m_totalRate

uint32_t anonymous_namespace{uan-rc-example.cc}::Experiment::m_totalRate

Total channel capacity.

Definition at line 82 of file uan-rc-example.cc.

Referenced by Experiment(), CreateMode(), and Run().


The documentation for this class was generated from the following file: