A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
NodeStatistics Class Reference

Class to collect node statistics. More...

+ Collaboration diagram for NodeStatistics:

Public Member Functions

 NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
 Constructor.
 
 NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
 Constructor.
 
 NodeStatistics (NetDeviceContainer aps, NetDeviceContainer stas)
 Constructor.
 
void AdvancePosition (Ptr< Node > node, int stepsSize, int stepsTime)
 Move a node.
 
void AdvancePosition (Ptr< Node > node, int stepsSize, int stepsTime)
 Advance node position.
 
void CheckStatistics (double time)
 Collects the statistics at a given time.
 
Gnuplot2dDataset GetBusyDatafile ()
 Get the BUSY state output data.
 
double GetBusyTime () const
 Get the Busy time.
 
Gnuplot2dDataset GetDatafile ()
 Get the Throughput output data.
 
Gnuplot2dDataset GetDatafile ()
 Get the Throughput output data.
 
Gnuplot2dDataset GetDatafile ()
 
Gnuplot2dDataset GetIdleDatafile ()
 Get the IDLE state output data.
 
Vector GetPosition (Ptr< Node > node)
 Get the Position of a node.
 
Vector GetPosition (Ptr< Node > node)
 Get node position.
 
Gnuplot2dDataset GetPowerDatafile ()
 Get the Power output data.
 
Gnuplot2dDataset GetPowerDatafile ()
 Get the Power output data.
 
Gnuplot2dDataset GetRxDatafile ()
 Get the RX state output data.
 
Gnuplot2dDataset GetTxDatafile ()
 Get the TX state output data.
 
void PhyCallback (std::string path, Ptr< const Packet > packet, double powerW)
 Callback called by WifiNetDevice/Phy/PhyTxBegin.
 
void PhyCallback (std::string path, Ptr< const Packet > packet, double powerW)
 Callback called by WifiNetDevice/Phy/PhyTxBegin.
 
void PowerCallback (std::string path, double oldPower, double newPower, Mac48Address dest)
 Callback called by WifiNetDevice/RemoteStationManager/x/PowerChange.
 
void PowerCallback (std::string path, double oldPower, double newPower, Mac48Address dest)
 Callback called by WifiNetDevice/RemoteStationManager/x/PowerChange.
 
void RateCallback (std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
 Callback called by WifiNetDevice/RemoteStationManager/x/RateChange.
 
void RateCallback (std::string path, DataRate oldRate, DataRate newRate, Mac48Address dest)
 Callback called by WifiNetDevice/RemoteStationManager/x/RateChange.
 
void RxCallback (std::string path, Ptr< const Packet > packet, const Address &from)
 Callback called by PacketSink/Rx.
 
void RxCallback (std::string path, Ptr< const Packet > packet, const Address &from)
 Callback called by PacketSink/Rx.
 
void RxCallback (std::string path, Ptr< const Packet > packet, const Address &from)
 RX callback.
 
void SetPosition (Ptr< Node > node, Vector position)
 Set the Position of a node.
 
void SetPosition (Ptr< Node > node, Vector position)
 Set node position.
 
void StateCallback (std::string path, Time init, Time duration, WifiPhyState state)
 Callback called by YansWifiPhy/State/State.
 

Private Types

typedef std::vector< std::pair< Time, DataRate > > TxTime
 Time, DataRate pair vector.
 
typedef std::vector< std::pair< Time, DataRate > > TxTime
 Time, DataRate pair vector.
 

Private Member Functions

Time GetCalcTxTime (DataRate rate)
 Get the time at which a given datarate has been recorded.
 
Time GetCalcTxTime (DataRate rate)
 Get the time at which a given datarate has been recorded.
 
void SetupPhy (Ptr< WifiPhy > phy)
 Setup the WifiPhy object.
 
void SetupPhy (Ptr< WifiPhy > phy)
 Setup the WifiPhy object.
 

Private Attributes

double busyTime
 BUSY time.
 
double idleTime
 IDLE time.
 
uint32_t m_bytesTotal
 Number of received bytes on a given state.
 
std::map< Mac48Address, doublem_currentPower
 Current Tx power for each sender.
 
std::map< Mac48Address, DataRatem_currentRate
 Current Tx rate for each sender.
 
Gnuplot2dDataset m_output
 Throughput output data.
 
Gnuplot2dDataset m_output_busy
 BUSY output data.
 
Gnuplot2dDataset m_output_idle
 IDLE output data.
 
Gnuplot2dDataset m_output_power
 Power output data.
 
Gnuplot2dDataset m_output_rx
 RX output data.
 
Gnuplot2dDataset m_output_tx
 TX output data.
 
TxTime m_timeTable
 Time, DataRate table.
 
double m_totalBusyTime
 Total time in BUSY state.
 
double m_totalEnergy
 Energy used on a given state.
 
double m_totalIdleTime
 Total time in IDLE state.
 
double m_totalRxTime
 Total time in RX state.
 
double m_totalTime
 Time spent on a given state.
 
double m_totalTxTime
 Total time in TX state.
 
double rxTime
 RX time.
 
double txTime
 TX time.
 

Detailed Description

Class to collect node statistics.

Node statistics.

Definition at line 116 of file wifi-power-adaptation-distance.cc.

Member Typedef Documentation

◆ TxTime [1/2]

typedef std::vector<std::pair<Time, DataRate> > NodeStatistics::TxTime
private

Time, DataRate pair vector.

Definition at line 198 of file wifi-power-adaptation-distance.cc.

◆ TxTime [2/2]

typedef std::vector<std::pair<Time, DataRate> > NodeStatistics::TxTime
private

Time, DataRate pair vector.

Definition at line 196 of file wifi-power-adaptation-interference.cc.

Constructor & Destructor Documentation

◆ NodeStatistics() [1/3]

NodeStatistics::NodeStatistics ( NetDeviceContainer  aps,
NetDeviceContainer  stas 
)

Constructor.

Parameters
apsAccess points
stasWiFi Stations.

Definition at line 223 of file wifi-power-adaptation-distance.cc.

References ns3::NetDeviceContainer::Get(), ns3::NetDeviceContainer::GetN(), m_bytesTotal, m_currentPower, m_currentRate, m_output, m_output_power, m_totalEnergy, m_totalTime, ns3::GnuplotDataset::SetTitle(), and SetupPhy().

+ Here is the call graph for this function:

◆ NodeStatistics() [2/3]

NodeStatistics::NodeStatistics ( NetDeviceContainer  aps,
NetDeviceContainer  stas 
)

Constructor.

Parameters
apsAccess points
stasWiFi Stations.

◆ NodeStatistics() [3/3]

NodeStatistics::NodeStatistics ( NetDeviceContainer  aps,
NetDeviceContainer  stas 
)

Constructor.

Parameters
apsAP devices
stasSTA devices

Member Function Documentation

◆ AdvancePosition() [1/2]

void NodeStatistics::AdvancePosition ( Ptr< Node node,
int  stepsSize,
int  stepsTime 
)

Move a node.

Parameters
nodeThe node.
stepsSizeThe step size.
stepsTimeTime on each step.

Definition at line 328 of file wifi-power-adaptation-distance.cc.

References ns3::Gnuplot2dDataset::Add(), AdvancePosition(), GetPosition(), m_bytesTotal, m_output, m_output_power, m_totalEnergy, m_totalTime, ns3::Simulator::Now(), NS_LOG_INFO, ns3::Simulator::Schedule(), ns3::Seconds(), and SetPosition().

Referenced by AdvancePosition().

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

◆ AdvancePosition() [2/2]

void NodeStatistics::AdvancePosition ( Ptr< Node node,
int  stepsSize,
int  stepsTime 
)

Advance node position.

Parameters
nodethe node
stepsSizethe size of a step
stepsTimethe time interval between steps

◆ CheckStatistics()

void NodeStatistics::CheckStatistics ( double  time)

Collects the statistics at a given time.

Parameters
timeTime at which the statistics are collected.

Definition at line 360 of file wifi-power-adaptation-interference.cc.

References ns3::Gnuplot2dDataset::Add(), busyTime, CheckStatistics(), idleTime, m_bytesTotal, m_output, m_output_busy, m_output_idle, m_output_power, m_output_rx, m_output_tx, m_totalEnergy, m_totalTime, ns3::Simulator::Now(), rxTime, ns3::Simulator::Schedule(), ns3::Seconds(), and txTime.

Referenced by CheckStatistics().

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

◆ GetBusyDatafile()

Gnuplot2dDataset NodeStatistics::GetBusyDatafile ( )

Get the BUSY state output data.

Returns
the BUSY state output data.

Definition at line 401 of file wifi-power-adaptation-interference.cc.

References m_output_busy.

◆ GetBusyTime()

double NodeStatistics::GetBusyTime ( ) const

Get the Busy time.

Returns
the busy time.

Definition at line 419 of file wifi-power-adaptation-interference.cc.

References m_totalBusyTime, and m_totalRxTime.

◆ GetCalcTxTime() [1/2]

Time NodeStatistics::GetCalcTxTime ( DataRate  rate)
private

Get the time at which a given datarate has been recorded.

Parameters
rateThe datarate to search.
Returns
the time.

Definition at line 264 of file wifi-power-adaptation-distance.cc.

References m_timeTable, NS_ASSERT, and ns3::Seconds().

Referenced by PhyCallback().

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

◆ GetCalcTxTime() [2/2]

Time NodeStatistics::GetCalcTxTime ( DataRate  rate)
private

Get the time at which a given datarate has been recorded.

Parameters
rateThe datarate to search.
Returns
the time.

◆ GetDatafile() [1/3]

Gnuplot2dDataset NodeStatistics::GetDatafile ( )

Get the Throughput output data.

Returns
the Throughput output data.

Definition at line 351 of file wifi-power-adaptation-distance.cc.

References m_output.

◆ GetDatafile() [2/3]

Gnuplot2dDataset NodeStatistics::GetDatafile ( )

Get the Throughput output data.

Returns
the Throughput output data.

◆ GetDatafile() [3/3]

Gnuplot2dDataset NodeStatistics::GetDatafile ( )
Returns
the gnuplot 2d dataset

◆ GetIdleDatafile()

Gnuplot2dDataset NodeStatistics::GetIdleDatafile ( )

Get the IDLE state output data.

Returns
the IDLE state output data.

Definition at line 395 of file wifi-power-adaptation-interference.cc.

References m_output_idle.

◆ GetPosition() [1/2]

Vector NodeStatistics::GetPosition ( Ptr< Node node)

Get the Position of a node.

Parameters
nodeThe node.
Returns
the position of the node.

Definition at line 321 of file wifi-power-adaptation-distance.cc.

Referenced by AdvancePosition().

+ Here is the caller graph for this function:

◆ GetPosition() [2/2]

Vector NodeStatistics::GetPosition ( Ptr< Node node)

Get node position.

Parameters
nodethe node
Returns
the position

◆ GetPowerDatafile() [1/2]

Gnuplot2dDataset NodeStatistics::GetPowerDatafile ( )

Get the Power output data.

Returns
the Power output data.

Definition at line 357 of file wifi-power-adaptation-distance.cc.

References m_output_power.

◆ GetPowerDatafile() [2/2]

Gnuplot2dDataset NodeStatistics::GetPowerDatafile ( )

Get the Power output data.

Returns
the Power output data.

◆ GetRxDatafile()

Gnuplot2dDataset NodeStatistics::GetRxDatafile ( )

Get the RX state output data.

Returns
the RX state output data.

Definition at line 407 of file wifi-power-adaptation-interference.cc.

References m_output_rx.

◆ GetTxDatafile()

Gnuplot2dDataset NodeStatistics::GetTxDatafile ( )

Get the TX state output data.

Returns
the TX state output data.

Definition at line 413 of file wifi-power-adaptation-interference.cc.

References m_output_tx.

◆ PhyCallback() [1/2]

void NodeStatistics::PhyCallback ( std::string  path,
Ptr< const Packet packet,
double  powerW 
)

Callback called by WifiNetDevice/Phy/PhyTxBegin.

Parameters
pathThe trace path.
packetThe sent packet.
powerWThe Tx power.

Definition at line 278 of file wifi-power-adaptation-distance.cc.

References ns3::WifiMacHeader::GetAddr1(), GetCalcTxTime(), ns3::Time::GetSeconds(), ns3::WifiMacHeader::GetType(), m_currentPower, m_currentRate, m_totalEnergy, m_totalTime, and ns3::WIFI_MAC_DATA.

+ Here is the call graph for this function:

◆ PhyCallback() [2/2]

void NodeStatistics::PhyCallback ( std::string  path,
Ptr< const Packet packet,
double  powerW 
)

Callback called by WifiNetDevice/Phy/PhyTxBegin.

Parameters
pathThe trace path.
packetThe sent packet.
powerWThe Tx power.

◆ PowerCallback() [1/2]

void NodeStatistics::PowerCallback ( std::string  path,
double  oldPower,
double  newPower,
Mac48Address  dest 
)

Callback called by WifiNetDevice/RemoteStationManager/x/PowerChange.

Parameters
pathThe trace path.
oldPowerOld Tx power.
newPowerActual Tx power.
destDestination of the transmission.

Definition at line 293 of file wifi-power-adaptation-distance.cc.

References m_currentPower.

◆ PowerCallback() [2/2]

void NodeStatistics::PowerCallback ( std::string  path,
double  oldPower,
double  newPower,
Mac48Address  dest 
)

Callback called by WifiNetDevice/RemoteStationManager/x/PowerChange.

Parameters
pathThe trace path.
oldPowerOld Tx power.
newPowerActual Tx power.
destDestination of the transmission.

◆ RateCallback() [1/2]

void NodeStatistics::RateCallback ( std::string  path,
DataRate  oldRate,
DataRate  newRate,
Mac48Address  dest 
)

Callback called by WifiNetDevice/RemoteStationManager/x/RateChange.

Parameters
pathThe trace path.
oldRateOld rate.
newRateActual rate.
destDestination of the transmission.

Definition at line 299 of file wifi-power-adaptation-distance.cc.

References m_currentRate.

◆ RateCallback() [2/2]

void NodeStatistics::RateCallback ( std::string  path,
DataRate  oldRate,
DataRate  newRate,
Mac48Address  dest 
)

Callback called by WifiNetDevice/RemoteStationManager/x/RateChange.

Parameters
pathThe trace path.
oldRateOld rate.
newRateActual rate.
destDestination of the transmission.

◆ RxCallback() [1/3]

void NodeStatistics::RxCallback ( std::string  path,
Ptr< const Packet packet,
const Address from 
)

Callback called by PacketSink/Rx.

Parameters
pathThe trace path.
packetThe received packet.
fromThe sender address.

Definition at line 308 of file wifi-power-adaptation-distance.cc.

References m_bytesTotal.

◆ RxCallback() [2/3]

void NodeStatistics::RxCallback ( std::string  path,
Ptr< const Packet packet,
const Address from 
)

Callback called by PacketSink/Rx.

Parameters
pathThe trace path.
packetThe received packet.
fromThe sender address.

◆ RxCallback() [3/3]

void NodeStatistics::RxCallback ( std::string  path,
Ptr< const Packet packet,
const Address from 
)

RX callback.

Parameters
pathpath
packetreceived packet
fromsender

◆ SetPosition() [1/2]

void NodeStatistics::SetPosition ( Ptr< Node node,
Vector  position 
)

Set the Position of a node.

Parameters
nodeThe node.
positionThe position.

Definition at line 314 of file wifi-power-adaptation-distance.cc.

Referenced by AdvancePosition().

+ Here is the caller graph for this function:

◆ SetPosition() [2/2]

void NodeStatistics::SetPosition ( Ptr< Node node,
Vector  position 
)

Set node position.

Parameters
nodethe node
positionthe position

◆ SetupPhy() [1/2]

void NodeStatistics::SetupPhy ( Ptr< WifiPhy phy)
private

Setup the WifiPhy object.

Parameters
phyThe WifiPhy to setup.

Definition at line 248 of file wifi-power-adaptation-distance.cc.

References ns3::Time::GetSeconds(), m_timeTable, NS_LOG_DEBUG, packetSize, ns3::WifiTxVector::SetChannelWidth(), ns3::WifiTxVector::SetMode(), ns3::WifiTxVector::SetPreambleType(), and ns3::WIFI_PREAMBLE_LONG.

Referenced by NodeStatistics().

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

◆ SetupPhy() [2/2]

void NodeStatistics::SetupPhy ( Ptr< WifiPhy phy)
private

Setup the WifiPhy object.

Parameters
phyThe WifiPhy to setup.

◆ StateCallback()

void NodeStatistics::StateCallback ( std::string  path,
Time  init,
Time  duration,
WifiPhyState  state 
)

Callback called by YansWifiPhy/State/State.

Parameters
pathThe trace path.
initTime when the state started.
durationAmount of time we've been in (or will be in) the state.
stateThe state.

Definition at line 329 of file wifi-power-adaptation-interference.cc.

References busyTime, ns3::Time::GetSeconds(), idleTime, m_totalBusyTime, m_totalIdleTime, m_totalRxTime, m_totalTxTime, rxTime, and txTime.

+ Here is the call graph for this function:

Member Data Documentation

◆ busyTime

double NodeStatistics::busyTime
private

BUSY time.

Definition at line 216 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and StateCallback().

◆ idleTime

double NodeStatistics::idleTime
private

IDLE time.

Definition at line 217 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and StateCallback().

◆ m_bytesTotal

uint32_t NodeStatistics::m_bytesTotal
private

Number of received bytes on a given state.

total bytes

Number of received bytes.

Definition at line 215 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), AdvancePosition(), CheckStatistics(), and RxCallback().

◆ m_currentPower

std::map< Mac48Address, double > NodeStatistics::m_currentPower
private

Current Tx power for each sender.

Definition at line 213 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), PhyCallback(), and PowerCallback().

◆ m_currentRate

std::map< Mac48Address, DataRate > NodeStatistics::m_currentRate
private

Current Tx rate for each sender.

Definition at line 214 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), PhyCallback(), and RateCallback().

◆ m_output

Gnuplot2dDataset NodeStatistics::m_output
private

Throughput output data.

gnuplot 2d dataset

Definition at line 219 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), AdvancePosition(), CheckStatistics(), and GetDatafile().

◆ m_output_busy

Gnuplot2dDataset NodeStatistics::m_output_busy
private

BUSY output data.

Definition at line 228 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and GetBusyDatafile().

◆ m_output_idle

Gnuplot2dDataset NodeStatistics::m_output_idle
private

IDLE output data.

Definition at line 227 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and GetIdleDatafile().

◆ m_output_power

Gnuplot2dDataset NodeStatistics::m_output_power
private

Power output data.

Definition at line 220 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), AdvancePosition(), CheckStatistics(), and GetPowerDatafile().

◆ m_output_rx

Gnuplot2dDataset NodeStatistics::m_output_rx
private

RX output data.

Definition at line 229 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and GetRxDatafile().

◆ m_output_tx

Gnuplot2dDataset NodeStatistics::m_output_tx
private

TX output data.

Definition at line 230 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and GetTxDatafile().

◆ m_timeTable

TxTime NodeStatistics::m_timeTable
private

Time, DataRate table.

Definition at line 218 of file wifi-power-adaptation-distance.cc.

Referenced by GetCalcTxTime(), and SetupPhy().

◆ m_totalBusyTime

double NodeStatistics::m_totalBusyTime
private

Total time in BUSY state.

Definition at line 220 of file wifi-power-adaptation-interference.cc.

Referenced by GetBusyTime(), and StateCallback().

◆ m_totalEnergy

double NodeStatistics::m_totalEnergy
private

Energy used on a given state.

Energy used.

Definition at line 216 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), AdvancePosition(), CheckStatistics(), and PhyCallback().

◆ m_totalIdleTime

double NodeStatistics::m_totalIdleTime
private

Total time in IDLE state.

Definition at line 221 of file wifi-power-adaptation-interference.cc.

Referenced by StateCallback().

◆ m_totalRxTime

double NodeStatistics::m_totalRxTime
private

Total time in RX state.

Definition at line 223 of file wifi-power-adaptation-interference.cc.

Referenced by GetBusyTime(), and StateCallback().

◆ m_totalTime

double NodeStatistics::m_totalTime
private

Time spent on a given state.

Time spent.

Definition at line 217 of file wifi-power-adaptation-distance.cc.

Referenced by NodeStatistics(), AdvancePosition(), CheckStatistics(), and PhyCallback().

◆ m_totalTxTime

double NodeStatistics::m_totalTxTime
private

Total time in TX state.

Definition at line 222 of file wifi-power-adaptation-interference.cc.

Referenced by StateCallback().

◆ rxTime

double NodeStatistics::rxTime
private

RX time.

Definition at line 219 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and StateCallback().

◆ txTime

double NodeStatistics::txTime
private

TX time.

Definition at line 218 of file wifi-power-adaptation-interference.cc.

Referenced by CheckStatistics(), and StateCallback().


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