This example was originally devised as a test, then it was converted to an example. More...
Classes | |
struct | LoadProfile |
Load profile of the battery. More... | |
Public Member Functions | |
BatteryLifetimeTest () | |
virtual | ~BatteryLifetimeTest () |
bool | ConstantLoadTest (double load, Time expLifetime) const |
void | CreateLoadProfiles () |
Creates load profiles according to D. More... | |
bool | VariableLoadTest (std::vector< double > loads, std::vector< Time > timeStamps, Time expLifetime) const |
Public Attributes | |
double | m_alpha |
Alpha parameter of the battery model. More... | |
double | m_beta |
Beta parameter of the battery model. More... | |
std::vector< LoadProfile > | m_loadProfiles |
Load profiles. More... | |
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,
Definition at line 54 of file rv-battery-model-test.cc.
BatteryLifetimeTest::BatteryLifetimeTest | ( | ) |
Definition at line 105 of file rv-battery-model-test.cc.
|
virtual |
Definition at line 112 of file rv-battery-model-test.cc.
bool BatteryLifetimeTest::ConstantLoadTest | ( | double | load, |
Time | expLifetime | ||
) | const |
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 718 of file rv-battery-model-test.cc.
References ns3::Time::As(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::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::WifiPhyHelper::Set(), ns3::RvBatteryModelHelper::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 | ( | ) |
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 117 of file rv-battery-model-test.cc.
References BatteryLifetimeTest::LoadProfile::dualFoilLifeTime, BatteryLifetimeTest::LoadProfile::itsyLifetime, BatteryLifetimeTest::LoadProfile::loads, ns3::Seconds(), and BatteryLifetimeTest::LoadProfile::timeStamps.
bool BatteryLifetimeTest::VariableLoadTest | ( | std::vector< double > | loads, |
std::vector< Time > | timeStamps, | ||
Time | expLifetime | ||
) | const |
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 801 of file rv-battery-model-test.cc.
References ns3::Abs(), ns3::Time::As(), ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::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::WifiPhyHelper::Set(), ns3::RvBatteryModelHelper::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 |
Alpha parameter of the battery model.
Definition at line 101 of file rv-battery-model-test.cc.
double BatteryLifetimeTest::m_beta |
Beta parameter of the battery model.
Definition at line 102 of file rv-battery-model-test.cc.
std::vector<LoadProfile> BatteryLifetimeTest::m_loadProfiles |
Load profiles.
Definition at line 100 of file rv-battery-model-test.cc.