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. | |
bool | VariableLoadTest (std::vector< double > loads, std::vector< Time > timeStamps, Time expLifetime) const |
Public Attributes | |
double | m_alpha |
Alpha parameter of the battery model. | |
double | m_beta |
Beta parameter of the battery model. | |
std::vector< LoadProfile > | m_loadProfiles |
Load profiles. | |
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 44 of file rv-battery-model-test.cc.
BatteryLifetimeTest::BatteryLifetimeTest | ( | ) |
Definition at line 95 of file rv-battery-model-test.cc.
|
virtual |
Definition at line 102 of file rv-battery-model-test.cc.
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 708 of file rv-battery-model-test.cc.
References ns3::Time::As(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::Simulator::Destroy(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DynamicCast(), ns3::energy::EnergySourceContainer::Get(), ns3::DeviceEnergyModelHelper::Install(), ns3::EnergySourceHelper::Install(), m_alpha, m_beta, 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(), 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 107 of file rv-battery-model-test.cc.
References BatteryLifetimeTest::LoadProfile::dualFoilLifeTime, BatteryLifetimeTest::LoadProfile::itsyLifetime, BatteryLifetimeTest::LoadProfile::loads, m_loadProfiles, 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 791 of file rv-battery-model-test.cc.
References ns3::Abs(), ns3::Time::As(), ns3::NodeContainer::Create(), ns3::YansWifiChannelHelper::Create(), ns3::Simulator::Destroy(), ns3::WifiPhyHelper::DLT_IEEE802_11_RADIO, ns3::DynamicCast(), ns3::energy::DeviceEnergyModelContainer::Get(), ns3::energy::EnergySourceContainer::Get(), ns3::DeviceEnergyModelHelper::Install(), ns3::EnergySourceHelper::Install(), m_alpha, m_beta, 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(), and ns3::WIFI_STANDARD_80211b.
double BatteryLifetimeTest::m_alpha |
Alpha parameter of the battery model.
Definition at line 91 of file rv-battery-model-test.cc.
Referenced by BatteryLifetimeTest(), ConstantLoadTest(), and VariableLoadTest().
double BatteryLifetimeTest::m_beta |
Beta parameter of the battery model.
Definition at line 92 of file rv-battery-model-test.cc.
Referenced by BatteryLifetimeTest(), ConstantLoadTest(), and VariableLoadTest().
std::vector<LoadProfile> BatteryLifetimeTest::m_loadProfiles |
Load profiles.
Definition at line 90 of file rv-battery-model-test.cc.
Referenced by CreateLoadProfiles().