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

Test case of energy depletion handling for BasicEnergySource and WifiRadioEnergyModel. More...

+ Collaboration diagram for BasicEnergyDepletionTest:

Public Member Functions

 BasicEnergyDepletionTest ()
 
virtual ~BasicEnergyDepletionTest ()
 
bool DoRun ()
 Performs some tests involving energy depletion.
 

Private Member Functions

void DepletionHandler ()
 Callback invoked when energy is drained from source.
 
bool DepletionTestCase (double simTimeS, double updateIntervalS)
 

Private Attributes

int m_callbackCount
 counter for # of callbacks invoked
 
int m_numOfNodes
 number of nodes in simulation
 
double m_simTimeS
 maximum simulation time, in seconds
 
double m_timeStepS
 simulation time step size, in seconds
 
double m_updateIntervalS
 update interval of each device model
 

Detailed Description

Test case of energy depletion handling for BasicEnergySource and WifiRadioEnergyModel.

Definition at line 254 of file basic-energy-model-test.cc.

Constructor & Destructor Documentation

◆ BasicEnergyDepletionTest()

BasicEnergyDepletionTest::BasicEnergyDepletionTest ( )

◆ ~BasicEnergyDepletionTest()

BasicEnergyDepletionTest::~BasicEnergyDepletionTest ( )
virtual

Definition at line 298 of file basic-energy-model-test.cc.

Member Function Documentation

◆ DepletionHandler()

void BasicEnergyDepletionTest::DepletionHandler ( )
private

Callback invoked when energy is drained from source.

Definition at line 328 of file basic-energy-model-test.cc.

References m_callbackCount.

Referenced by DepletionTestCase().

+ Here is the caller graph for this function:

◆ DepletionTestCase()

bool BasicEnergyDepletionTest::DepletionTestCase ( double  simTimeS,
double  updateIntervalS 
)
private
Parameters
simTimeSSimulation time, in seconds.
updateIntervalSDevice model update interval, in seconds.
Returns
False if all is good.

Runs simulation with specified simulation time and update interval.

Definition at line 334 of file basic-energy-model-test.cc.

References ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), DepletionHandler(), ns3::Simulator::Destroy(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DeviceEnergyModelHelper::Install(), ns3::EnergySourceHelper::Install(), m_callbackCount, m_numOfNodes, ns3::MakeCallback(), NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::Seconds(), ns3::WifiPhyHelper::Set(), ns3::BasicEnergySourceHelper::Set(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::WifiRadioEnergyModelHelper::SetDepletionCallback(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiMacHelper::SetType(), ns3::Simulator::Stop(), and ns3::WIFI_STANDARD_80211b.

Referenced by DoRun().

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

◆ DoRun()

bool BasicEnergyDepletionTest::DoRun ( )

Performs some tests involving energy depletion.

Returns
true is some error happened.

Definition at line 303 of file basic-energy-model-test.cc.

References DepletionTestCase(), m_callbackCount, m_simTimeS, m_timeStepS, and m_updateIntervalS.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_callbackCount

int BasicEnergyDepletionTest::m_callbackCount
private

counter for # of callbacks invoked

Definition at line 283 of file basic-energy-model-test.cc.

Referenced by BasicEnergyDepletionTest(), DepletionHandler(), DepletionTestCase(), and DoRun().

◆ m_numOfNodes

int BasicEnergyDepletionTest::m_numOfNodes
private

number of nodes in simulation

Definition at line 282 of file basic-energy-model-test.cc.

Referenced by BasicEnergyDepletionTest(), and DepletionTestCase().

◆ m_simTimeS

double BasicEnergyDepletionTest::m_simTimeS
private

maximum simulation time, in seconds

Definition at line 284 of file basic-energy-model-test.cc.

Referenced by BasicEnergyDepletionTest(), and DoRun().

◆ m_timeStepS

double BasicEnergyDepletionTest::m_timeStepS
private

simulation time step size, in seconds

Definition at line 285 of file basic-energy-model-test.cc.

Referenced by BasicEnergyDepletionTest(), and DoRun().

◆ m_updateIntervalS

double BasicEnergyDepletionTest::m_updateIntervalS
private

update interval of each device model

Definition at line 286 of file basic-energy-model-test.cc.

Referenced by BasicEnergyDepletionTest(), and DoRun().


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