Test case of update remaining energy for RvBatteryModel and WifiRadioEnergyModel. More...
Public Member Functions | |
BatteryLifetimeTest () | |
virtual | ~BatteryLifetimeTest () |
Public Member Functions inherited from ns3::TestCase | |
virtual | ~TestCase () |
Destructor. More... | |
Private Member Functions | |
bool | ConstantLoadTest (double load, Time expLifetime) |
void | CreateLoadProfiles (void) |
Creates load profiles according to "Battery Lifetime Prediction for Energy-
Aware Computing" paper. More... | |
void | DoRun (void) |
bool | VariableLoadTest (std::vector< double > loads, std::vector< Time > timeStamps, Time expLifetime) |
Private Attributes | |
double | m_alpha |
double | m_beta |
std::vector< LoadProfile > | m_loadProfiles |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { QUICK = 1, EXTENSIVE = 2, TAKES_FOREVER = 3 } |
How long the test takes to execute. More... | |
Protected Member Functions inherited from ns3::TestCase | |
TestCase (std::string name) | |
void | AddTestCase (TestCase *testCase) NS_DEPRECATED |
Add an individual child TestCase case to this TestCase. More... | |
void | AddTestCase (TestCase *testCase, enum TestDuration duration) |
Add an individual child TestCase to this test suite. More... | |
std::string | CreateDataDirFilename (std::string filename) |
std::string | CreateTempDirFilename (std::string filename) |
bool | GetErrorStatus (void) const NS_DEPRECATED |
std::string | GetName (void) const |
bool | IsStatusFailure (void) const |
bool | IsStatusSuccess (void) const |
bool | MustAssertOnFailure (void) const |
bool | MustContinueOnFailure (void) const |
void | ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line) |
void | SetDataDir (std::string directory) |
Test case of update remaining energy for RvBatteryModel and WifiRadioEnergyModel.
Definition at line 46 of file rv-battery-model-test.cc.
BatteryLifetimeTest::BatteryLifetimeTest | ( | ) |
Definition at line 104 of file rv-battery-model-test.cc.
|
virtual |
Definition at line 112 of file rv-battery-model-test.cc.
|
private |
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 693 of file rv-battery-model-test.cc.
References ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), first::devices, ns3::EnergySourceContainer::Get(), ns3::RvBatteryModel::GetLifetime(), ns3::Time::GetSeconds(), ns3::EnergySourceHelper::Install(), ns3::DeviceEnergyModelHelper::Install(), ns3::WifiHelper::Install(), m_alpha, m_beta, NS_LOG_DEBUG, NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL, ns3::RvBatteryModelHelper::Set(), ns3::WifiRadioEnergyModelHelper::Set(), ns3::YansWifiPhyHelper::Set(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::YansWifiPhyHelper::SetPcapDataLinkType(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiHelper::SetRemoteStationManager(), ns3::WifiHelper::SetStandard(), ns3::NqosWifiMacHelper::SetType(), and ns3::WIFI_PHY_STANDARD_80211b.
Referenced by DoRun().
|
private |
Creates load profiles according to "Battery Lifetime Prediction for Energy- Aware Computing" paper.
Definition at line 117 of file rv-battery-model-test.cc.
References LoadProfile::dualFoilLifeTime, LoadProfile::itsyLifetime, LoadProfile::loads, m_loadProfiles, and LoadProfile::timeStamps.
Referenced by DoRun().
|
privatevirtual |
Runs test.
Implements ns3::TestCase.
Definition at line 641 of file rv-battery-model-test.cc.
References ConstantLoadTest(), CreateLoadProfiles(), m_alpha, m_beta, m_loadProfiles, NS_LOG_DEBUG, NS_TEST_ASSERT_MSG_EQ, and VariableLoadTest().
|
private |
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 776 of file rv-battery-model-test.cc.
References ns3::YansWifiChannelHelper::Create(), ns3::NodeContainer::Create(), first::devices, ns3::DeviceEnergyModelContainer::Get(), ns3::EnergySourceContainer::Get(), ns3::RvBatteryModel::GetLifetime(), ns3::Time::GetSeconds(), ns3::EnergySourceHelper::Install(), ns3::DeviceEnergyModelHelper::Install(), ns3::WifiHelper::Install(), m_alpha, m_beta, NS_ASSERT, NS_LOG_DEBUG, NS_TEST_ASSERT_MSG_EQ_TOL_RETURNS_BOOL, ns3::RvBatteryModelHelper::Set(), ns3::WifiRadioEnergyModelHelper::Set(), ns3::YansWifiPhyHelper::Set(), ns3::YansWifiPhyHelper::SetChannel(), ns3::Config::SetDefault(), ns3::YansWifiPhyHelper::SetPcapDataLinkType(), ns3::YansWifiChannelHelper::SetPropagationDelay(), ns3::WifiHelper::SetRemoteStationManager(), ns3::WifiHelper::SetStandard(), ns3::NqosWifiMacHelper::SetType(), and ns3::WIFI_PHY_STANDARD_80211b.
Referenced by DoRun().
|
private |
Definition at line 100 of file rv-battery-model-test.cc.
Referenced by BatteryLifetimeTest(), ConstantLoadTest(), DoRun(), and VariableLoadTest().
|
private |
Definition at line 101 of file rv-battery-model-test.cc.
Referenced by BatteryLifetimeTest(), ConstantLoadTest(), DoRun(), and VariableLoadTest().
|
private |
Definition at line 99 of file rv-battery-model-test.cc.
Referenced by CreateLoadProfiles(), and DoRun().