Test case of energy depletion handling for BasicEnergySource and WifiRadioEnergyModel. More...
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 | |
Test case of energy depletion handling for BasicEnergySource and WifiRadioEnergyModel.
Definition at line 244 of file basic-energy-model-test.cc.
BasicEnergyDepletionTest::BasicEnergyDepletionTest | ( | ) |
Definition at line 279 of file basic-energy-model-test.cc.
References m_callbackCount, m_numOfNodes, m_simTimeS, m_timeStepS, and m_updateIntervalS.
|
virtual |
Definition at line 288 of file basic-energy-model-test.cc.
|
private |
Callback invoked when energy is drained from source.
Definition at line 318 of file basic-energy-model-test.cc.
References m_callbackCount.
Referenced by DepletionTestCase().
|
private |
simTimeS | Simulation time, in seconds. |
updateIntervalS | Device model update interval, in seconds. |
Runs simulation with specified simulation time and update interval.
Definition at line 324 of file basic-energy-model-test.cc.
References ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::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::BasicEnergySourceHelper::Set(), ns3::WifiPhyHelper::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().
bool BasicEnergyDepletionTest::DoRun | ( | ) |
Performs some tests involving energy depletion.
Definition at line 293 of file basic-energy-model-test.cc.
References DepletionTestCase(), m_callbackCount, m_simTimeS, m_timeStepS, and m_updateIntervalS.
|
private |
counter for # of callbacks invoked
Definition at line 273 of file basic-energy-model-test.cc.
Referenced by BasicEnergyDepletionTest(), DepletionHandler(), DepletionTestCase(), and DoRun().
|
private |
number of nodes in simulation
Definition at line 272 of file basic-energy-model-test.cc.
Referenced by BasicEnergyDepletionTest(), and DepletionTestCase().
|
private |
maximum simulation time, in seconds
Definition at line 274 of file basic-energy-model-test.cc.
Referenced by BasicEnergyDepletionTest(), and DoRun().
|
private |
simulation time step size, in seconds
Definition at line 275 of file basic-energy-model-test.cc.
Referenced by BasicEnergyDepletionTest(), and DoRun().
|
private |
update interval of each device model
Definition at line 276 of file basic-energy-model-test.cc.
Referenced by BasicEnergyDepletionTest(), and DoRun().