Test case of update remaining energy for BasicEnergySource and WifiRadioEnergyModel. More...
Public Member Functions | |
BasicEnergyUpdateTest () | |
virtual | ~BasicEnergyUpdateTest () |
bool | DoRun () |
Performs some tests involving state updates and the relative energy consumption. | |
Private Member Functions | |
bool | StateSwitchTest (WifiPhyState state) |
Private Attributes | |
ObjectFactory | m_deviceEnergyModel |
Device energy model factory. | |
ObjectFactory | m_energySource |
Energy source factory. | |
double | m_timeS |
Time in seconds. | |
double | m_tolerance |
Tolerance for power estimation. | |
Test case of update remaining energy for BasicEnergySource and WifiRadioEnergyModel.
Definition at line 34 of file basic-energy-model-test.cc.
BasicEnergyUpdateTest::BasicEnergyUpdateTest | ( | ) |
Definition at line 64 of file basic-energy-model-test.cc.
References m_timeS, and m_tolerance.
|
virtual |
Definition at line 70 of file basic-energy-model-test.cc.
bool BasicEnergyUpdateTest::DoRun | ( | ) |
Performs some tests involving state updates and the relative energy consumption.
Definition at line 75 of file basic-energy-model-test.cc.
References m_deviceEnergyModel, m_energySource, ns3::ObjectFactory::SetTypeId(), and StateSwitchTest().
|
private |
state | Radio state to switch to. |
Runs simulation for a while, check if final state & remaining energy is correctly updated.
Definition at line 116 of file basic-energy-model-test.cc.
References ns3::WifiRadioEnergyModel::ChangeState(), ns3::ObjectFactory::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::DynamicCast(), ns3::energy::DeviceEnergyModelContainer::Get(), ns3::energy::DeviceEnergyModelContainer::GetN(), m_deviceEnergyModel, m_energySource, m_timeS, m_tolerance, NS_FATAL_ERROR, NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::Simulator::Schedule(), ns3::Seconds(), ns3::Simulator::Stop(), and ns3::energy::BasicEnergySource::UpdateEnergySource().
Referenced by DoRun().
|
private |
Device energy model factory.
Definition at line 61 of file basic-energy-model-test.cc.
Referenced by DoRun(), and StateSwitchTest().
|
private |
Energy source factory.
Definition at line 60 of file basic-energy-model-test.cc.
Referenced by DoRun(), and StateSwitchTest().
|
private |
Time in seconds.
Definition at line 57 of file basic-energy-model-test.cc.
Referenced by BasicEnergyUpdateTest(), and StateSwitchTest().
|
private |
Tolerance for power estimation.
Definition at line 58 of file basic-energy-model-test.cc.
Referenced by BasicEnergyUpdateTest(), and StateSwitchTest().