This example was originally devised as a test, then it was converted to an example. More...
Public Member Functions | |
BatteryLifetimeTest () | |
virtual | ~BatteryLifetimeTest () |
bool | ConstantLoadTest (double load, Time expLifetime) |
void | CreateLoadProfiles (void) |
Creates load profiles according to D. More... | |
bool | VariableLoadTest (std::vector< double > loads, std::vector< Time > timeStamps, Time expLifetime) |
Public Attributes | |
double | m_alpha |
double | m_beta |
std::vector< LoadProfile > | m_loadProfiles |
This example was originally devised as a test, then it was converted to an example.
The script tests the remaining energy for RvBatteryModel and WifiRadioEnergyModel updates. It does so by mimicking the procedure and results published in D. Rakhmatov, S. Vrudhula, D.A. Wallach, "Battery lifetime prediction for energy-aware computing," Proceedings of the 2002 International Symposium on Low Power Electronics and Design, 2002. ISLPED '02. doi: 10.1109/LPE.2002.146729
Definition at line 52 of file rv-battery-model-test.cc.
BatteryLifetimeTest::BatteryLifetimeTest | ( | ) |
Definition at line 102 of file rv-battery-model-test.cc.
|
virtual |
Definition at line 109 of file rv-battery-model-test.cc.
bool BatteryLifetimeTest::ConstantLoadTest | ( | double | load, |
Time | expLifetime | ||
) |
load | Load value, in Amperes (A). |
expLifetime | Expected lifetime. |
Runs simulation with constant load and checks the battery lifetime with known results.
Definition at line 715 of file rv-battery-model-test.cc.
References ns3::Time::As(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::Simulator::Destroy(), first::devices, ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::EnergySourceContainer::Get(), ns3::DeviceEnergyModelHelper::Install(), ns3::EnergySourceHelper::Install(), NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::Time::S, ns3::Seconds(), ns3::RvBatteryModelHelper::Set(), ns3::WifiPhyHelper::Set(), ns3::WifiRadioEnergyModelHelper::Set(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiMacHelper::SetType(), ns3::Simulator::Stop(), third::wifi, and ns3::WIFI_STANDARD_80211b.
void BatteryLifetimeTest::CreateLoadProfiles | ( | void | ) |
Creates load profiles according to D.
Rakhmatov, S. Vrudhula, D.A. Wallach, "Battery lifetime prediction for energy-aware computing," Proceedings of the 2002 International Symposium on Low Power Electronics and Design, 2002. ISLPED '02. doi: 10.1109/LPE.2002.146729
Definition at line 114 of file rv-battery-model-test.cc.
References LoadProfile::dualFoilLifeTime, LoadProfile::itsyLifetime, LoadProfile::loads, ns3::Seconds(), and LoadProfile::timeStamps.
bool BatteryLifetimeTest::VariableLoadTest | ( | std::vector< double > | loads, |
std::vector< Time > | timeStamps, | ||
Time | expLifetime | ||
) |
loads | Load profile. |
timeStamps | Time stamps. |
expLifetime | Expected lifetime. |
Runs simulation with variable load and checks the battery lifetime with known results.
Definition at line 798 of file rv-battery-model-test.cc.
References ns3::Abs(), ns3::Time::As(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::Simulator::Destroy(), first::devices, ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::EnergySourceContainer::Get(), ns3::DeviceEnergyModelContainer::Get(), ns3::DeviceEnergyModelHelper::Install(), ns3::EnergySourceHelper::Install(), NS_ASSERT, NS_LOG_DEBUG, ns3::Simulator::Run(), ns3::Time::S, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::RvBatteryModelHelper::Set(), ns3::WifiPhyHelper::Set(), ns3::WifiRadioEnergyModelHelper::Set(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::WifiRadioEnergyModel::SetIdleCurrentA(), ns3::WifiPhyHelper::SetPcapDataLinkType(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiMacHelper::SetType(), ns3::Simulator::Stop(), third::wifi, and ns3::WIFI_STANDARD_80211b.
double BatteryLifetimeTest::m_alpha |
Definition at line 98 of file rv-battery-model-test.cc.
double BatteryLifetimeTest::m_beta |
Definition at line 99 of file rv-battery-model-test.cc.
std::vector<LoadProfile> BatteryLifetimeTest::m_loadProfiles |
Definition at line 97 of file rv-battery-model-test.cc.