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. More... | |
Private Member Functions | |
bool | StateSwitchTest (WifiPhyState state) |
Private Attributes | |
ObjectFactory | m_deviceEnergyModel |
Device energy model factory. More... | |
ObjectFactory | m_energySource |
Energy source factory. More... | |
double | m_timeS |
Time in seconds. More... | |
double | m_tolerance |
Tolerance for power estimation. More... | |
Test case of update remaining energy for BasicEnergySource and WifiRadioEnergyModel.
Definition at line 44 of file basic-energy-model-test.cc.
BasicEnergyUpdateTest::BasicEnergyUpdateTest | ( | ) |
Definition at line 74 of file basic-energy-model-test.cc.
|
virtual |
Definition at line 80 of file basic-energy-model-test.cc.
bool BasicEnergyUpdateTest::DoRun | ( | void | ) |
|
private |
state | Radio state to switch to. |
Runs simulation for a while, check if final state & remaining energy is correctly updated.
Definition at line 126 of file basic-energy-model-test.cc.
References ns3::Object::AggregateObject(), ns3::EnergySource::AppendDeviceEnergyModel(), CCA_BUSY, ns3::WifiRadioEnergyModel::ChangeState(), ns3::Simulator::Destroy(), ns3::EnergySource::FindDeviceEnergyModels(), ns3::DeviceEnergyModelContainer::Get(), ns3::BasicEnergySource::GetInitialEnergy(), ns3::DeviceEnergyModelContainer::GetN(), ns3::BasicEnergySource::GetRemainingEnergy(), ns3::BasicEnergySource::GetSupplyVoltage(), IDLE, max, NS_FATAL_ERROR, NS_LOG_DEBUG, OFF, ns3::Simulator::Run(), RX, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::BasicEnergySource::SetInitialEnergy(), ns3::EnergySource::SetNode(), SLEEP, ns3::Simulator::Stop(), SWITCHING, TX, and ns3::BasicEnergySource::UpdateEnergySource().
|
private |
Device energy model factory.
Definition at line 71 of file basic-energy-model-test.cc.
|
private |
Energy source factory.
Definition at line 70 of file basic-energy-model-test.cc.
|
private |
Time in seconds.
Definition at line 67 of file basic-energy-model-test.cc.
|
private |
Tolerance for power estimation.
Definition at line 68 of file basic-energy-model-test.cc.