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

Helper class for UAN CW MAC example. More...

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

Public Member Functions

 Experiment ()
 Default constructor.
void IncrementCw (uint32_t cw)
 Compute average throughput for a set of runs, then increment CW.
void ReceivePacket (Ptr< Socket > socket)
 Receive all available packets from a socket.
void ResetData ()
 Save the throughput from a single run.
Gnuplot2dDataset Run (UanHelper &uan)
 Run an experiment across a range of congestion window values.
void UpdatePositions (NodeContainer &nodes) const
 Assign new random positions to a set of nodes.

Public Attributes

std::string m_asciitracefile
 Name for ascii trace file, default uan-cw-example.asc.
uint32_t m_avgs
 Number of topologies to test for each cw point.
std::string m_bhCfgFile
 (Unused)
double m_boundary
 Size of boundary in meters.
uint32_t m_bytesTotal
 Total bytes received.
uint32_t m_cwMax
 Max CW to simulate.
uint32_t m_cwMin
 Min CW to simulate.
uint32_t m_cwStep
 CW step size, default 10.
Gnuplot2dDataset m_data
 Container for the simulation data.
uint32_t m_dataRate
 DataRate in bps.
double m_depth
 Depth of transmitting and sink nodes.
std::string m_gnudatfile
 Name for GNU Plot output, default uan-cw-example.gpl.
uint32_t m_numNodes
 Number of transmitting nodes.
uint32_t m_packetSize
 Generated packet size in bytes.
Time m_simTime
 Simulation run time, default 1000 s.
Time m_slotTime
 Slot time duration.
std::vector< doublem_throughputs
 Throughput for each run.

Detailed Description

Helper class for UAN CW MAC example.

An experiment measures the average throughput for a series of CW values.

See also
uan-cw-example.cc

Definition at line 57 of file uan-cw-example.cc.

Constructor & Destructor Documentation

◆ Experiment()

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

Default constructor.

Definition at line 114 of file uan-cw-example.cc.

References m_asciitracefile, m_avgs, m_bhCfgFile, m_boundary, m_bytesTotal, m_cwMax, m_cwMin, m_cwStep, m_dataRate, m_depth, m_gnudatfile, m_numNodes, m_packetSize, m_simTime, m_slotTime, and ns3::Seconds().

Here is the call graph for this function:

Member Function Documentation

◆ IncrementCw()

void anonymous_namespace{uan-cw-example.cc}::Experiment::IncrementCw ( uint32_t cw)

Compute average throughput for a set of runs, then increment CW.

Parameters
cwCW value for completed runs.

Definition at line 142 of file uan-cw-example.cc.

References ns3::RngSeedManager::GetRun(), m_avgs, m_cwStep, m_data, m_throughputs, NS_ASSERT, NS_LOG_DEBUG, ns3::Config::Set(), and ns3::RngSeedManager::SetRun().

Referenced by Run().

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

◆ ReceivePacket()

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

Receive all available packets from a socket.

Parameters
socketThe receive socket.

Definition at line 176 of file uan-cw-example.cc.

References m_bytesTotal.

Referenced by Run().

Here is the caller graph for this function:

◆ ResetData()

void anonymous_namespace{uan-cw-example.cc}::Experiment::ResetData ( )

Save the throughput from a single run.

Definition at line 134 of file uan-cw-example.cc.

References m_bytesTotal, m_simTime, m_throughputs, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by Run().

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

◆ Run()

◆ UpdatePositions()

void anonymous_namespace{uan-cw-example.cc}::Experiment::UpdatePositions ( NodeContainer & nodes) const

Assign new random positions to a set of nodes.

New positions are randomly assigned within the bounding box.

Parameters
nodesThe nodes to reposition.

Definition at line 163 of file uan-cw-example.cc.

References ns3::CreateObject(), m_boundary, nodes, ns3::Now(), NS_LOG_DEBUG, and ns3::Time::S.

Referenced by Run().

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

Member Data Documentation

◆ m_asciitracefile

std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_asciitracefile

Name for ascii trace file, default uan-cw-example.asc.

Definition at line 104 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_avgs

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_avgs

Number of topologies to test for each cw point.

Definition at line 98 of file uan-cw-example.cc.

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

◆ m_bhCfgFile

std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_bhCfgFile

(Unused)

Definition at line 105 of file uan-cw-example.cc.

Referenced by Experiment().

◆ m_boundary

double anonymous_namespace{uan-cw-example.cc}::Experiment::m_boundary

Size of boundary in meters.

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

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

◆ m_bytesTotal

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

Total bytes received.

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

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

◆ m_cwMax

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwMax

Max CW to simulate.

Definition at line 96 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_cwMin

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwMin

Min CW to simulate.

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

Referenced by Experiment(), and Run().

◆ m_cwStep

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_cwStep

CW step size, default 10.

Definition at line 97 of file uan-cw-example.cc.

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

◆ m_data

Gnuplot2dDataset anonymous_namespace{uan-cw-example.cc}::Experiment::m_data

Container for the simulation data.

Definition at line 107 of file uan-cw-example.cc.

Referenced by IncrementCw(), and Run().

◆ m_dataRate

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_dataRate

DataRate in bps.

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

Referenced by Experiment(), and Run().

◆ m_depth

double anonymous_namespace{uan-cw-example.cc}::Experiment::m_depth

Depth of transmitting and sink nodes.

Definition at line 91 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_gnudatfile

std::string anonymous_namespace{uan-cw-example.cc}::Experiment::m_gnudatfile

Name for GNU Plot output, default uan-cw-example.gpl.

Definition at line 103 of file uan-cw-example.cc.

Referenced by Experiment().

◆ m_numNodes

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

Number of transmitting nodes.

Definition at line 89 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_packetSize

uint32_t anonymous_namespace{uan-cw-example.cc}::Experiment::m_packetSize

Generated packet size in bytes.

Definition at line 93 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_simTime

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

Simulation run time, default 1000 s.

Definition at line 101 of file uan-cw-example.cc.

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

◆ m_slotTime

Time anonymous_namespace{uan-cw-example.cc}::Experiment::m_slotTime

Slot time duration.

Definition at line 100 of file uan-cw-example.cc.

Referenced by Experiment(), and Run().

◆ m_throughputs

std::vector<double> anonymous_namespace{uan-cw-example.cc}::Experiment::m_throughputs

Throughput for each run.

Definition at line 108 of file uan-cw-example.cc.

Referenced by IncrementCw(), and ResetData().


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