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)
 Advance node position.
 
void AdvancePosition (Ptr< Node > node, int stepsSize, Time stepsTime)
 Move a node.
 
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, dBm_um_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 101 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 183 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 181 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 208 of file wifi-power-adaptation-distance.cc.

◆ 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 )

Advance node position.

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

Definition at line 140 of file wifi-rate-adaptation-distance.cc.

References ns3::Gnuplot2dDataset::Add(), AdvancePosition(), GetPosition(), m_bytesTotal, m_output, ns3::Simulator::Schedule(), ns3::Seconds(), and SetPosition().

+ Here is the call graph for this function:

◆ AdvancePosition() [2/2]

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

Move a node.

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

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

Referenced by AdvancePosition().

+ Here is the caller graph for this function:

◆ CheckStatistics()

void NodeStatistics::CheckStatistics ( double time)

Collects the statistics at a given time.

Parameters
timeTime at which the statistics are collected.

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

◆ GetBusyDatafile()

Gnuplot2dDataset NodeStatistics::GetBusyDatafile ( )

Get the BUSY state output data.

Returns
the BUSY state output data.

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

◆ GetBusyTime()

double NodeStatistics::GetBusyTime ( ) const

Get the Busy time.

Returns
the busy time.

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

◆ 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 249 of file wifi-power-adaptation-distance.cc.

◆ 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 336 of file wifi-power-adaptation-distance.cc.

◆ 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 380 of file wifi-power-adaptation-interference.cc.

◆ 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 306 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 342 of file wifi-power-adaptation-distance.cc.

◆ 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 392 of file wifi-power-adaptation-interference.cc.

◆ GetTxDatafile()

Gnuplot2dDataset NodeStatistics::GetTxDatafile ( )

Get the TX state output data.

Returns
the TX state output data.

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

◆ 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 263 of file wifi-power-adaptation-distance.cc.

◆ 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 278 of file wifi-power-adaptation-distance.cc.

◆ 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 284 of file wifi-power-adaptation-distance.cc.

◆ 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 293 of file wifi-power-adaptation-distance.cc.

◆ 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 299 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 233 of file wifi-power-adaptation-distance.cc.

◆ 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 314 of file wifi-power-adaptation-interference.cc.

Member Data Documentation

◆ busyTime

double NodeStatistics::busyTime
private

BUSY time.

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

◆ idleTime

double NodeStatistics::idleTime
private

IDLE time.

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

◆ 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 200 of file wifi-power-adaptation-distance.cc.

Referenced by AdvancePosition().

◆ m_currentPower

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

Current Tx power for each sender.

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

◆ m_currentRate

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

Current Tx rate for each sender.

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

◆ m_output

Gnuplot2dDataset NodeStatistics::m_output
private

Throughput output data.

gnuplot 2d dataset

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

Referenced by AdvancePosition().

◆ m_output_busy

Gnuplot2dDataset NodeStatistics::m_output_busy
private

BUSY output data.

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

◆ m_output_idle

Gnuplot2dDataset NodeStatistics::m_output_idle
private

IDLE output data.

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

◆ m_output_power

Gnuplot2dDataset NodeStatistics::m_output_power
private

Power output data.

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

◆ m_output_rx

Gnuplot2dDataset NodeStatistics::m_output_rx
private

RX output data.

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

◆ m_output_tx

Gnuplot2dDataset NodeStatistics::m_output_tx
private

TX output data.

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

◆ m_timeTable

TxTime NodeStatistics::m_timeTable
private

Time, DataRate table.

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

◆ m_totalBusyTime

double NodeStatistics::m_totalBusyTime
private

Total time in BUSY state.

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

◆ m_totalEnergy

double NodeStatistics::m_totalEnergy
private

Energy used on a given state.

Energy used.

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

◆ m_totalIdleTime

double NodeStatistics::m_totalIdleTime
private

Total time in IDLE state.

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

◆ m_totalRxTime

double NodeStatistics::m_totalRxTime
private

Total time in RX state.

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

◆ m_totalTime

double NodeStatistics::m_totalTime
private

Time spent on a given state.

Time spent.

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

◆ m_totalTxTime

double NodeStatistics::m_totalTxTime
private

Total time in TX state.

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

◆ rxTime

double NodeStatistics::rxTime
private

RX time.

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

◆ txTime

double NodeStatistics::txTime
private

TX time.

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


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