Test case of update remaining energy for BasicEnergySource and WifiRadioEnergyModel. More...
Public Member Functions | |
BasicEnergyUpdateTest () | |
virtual | ~BasicEnergyUpdateTest () |
bool | DoRun (void) |
Performs some tests involving state updates and the relative energy consumption. More... | |
Private Member Functions | |
bool | StateSwitchTest (WifiPhy::State state) |
Private Attributes | |
ObjectFactory | m_deviceEnergyModel |
ObjectFactory | m_energySource |
double | m_timeS |
double | m_tolerance |
Test case of update remaining energy for BasicEnergySource and WifiRadioEnergyModel.
Definition at line 45 of file basic-energy-model-test.cc.
BasicEnergyUpdateTest::BasicEnergyUpdateTest | ( | ) |
Definition at line 75 of file basic-energy-model-test.cc.
|
virtual |
Definition at line 81 of file basic-energy-model-test.cc.
bool BasicEnergyUpdateTest::DoRun | ( | void | ) |
Performs some tests involving state updates and the relative energy consumption.
Definition at line 86 of file basic-energy-model-test.cc.
References ns3::WifiPhy::CCA_BUSY, ns3::WifiPhy::IDLE, ns3::WifiPhy::RX, ns3::WifiPhy::SLEEP, ns3::WifiPhy::SWITCHING, and ns3::WifiPhy::TX.
|
private |
state | Radio state to switch to. |
Runs simulation for a while, check if final state & remaining energy is correctly updated.
Definition at line 129 of file basic-energy-model-test.cc.
References ns3::Object::AggregateObject(), ns3::WifiPhy::CCA_BUSY, ns3::WifiRadioEnergyModel::ChangeState(), ns3::Simulator::Destroy(), ns3::DeviceEnergyModelContainer::Get(), ns3::WifiRadioEnergyModel::GetCcaBusyCurrentA(), ns3::WifiRadioEnergyModel::GetCurrentState(), ns3::WifiRadioEnergyModel::GetIdleCurrentA(), ns3::DeviceEnergyModelContainer::GetN(), ns3::WifiRadioEnergyModel::GetRxCurrentA(), ns3::WifiRadioEnergyModel::GetSleepCurrentA(), ns3::WifiRadioEnergyModel::GetSwitchingCurrentA(), ns3::WifiRadioEnergyModel::GetTxCurrentA(), ns3::WifiPhy::IDLE, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::WifiPhy::RX, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::WifiRadioEnergyModel::SetEnergySource(), ns3::WifiPhy::SLEEP, ns3::Simulator::Stop(), ns3::WifiPhy::SWITCHING, ns3::WifiPhy::TX, and ns3::BasicEnergySource::UpdateEnergySource().
|
private |
Definition at line 72 of file basic-energy-model-test.cc.
|
private |
Definition at line 71 of file basic-energy-model-test.cc.
|
private |
Definition at line 68 of file basic-energy-model-test.cc.
|
private |
Definition at line 69 of file basic-energy-model-test.cc.