A Discrete-Event Network Simulator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
BatteryLifetimeTest Class Reference

Test case of update remaining energy for RvBatteryModel and WifiRadioEnergyModel. More...

+ Inheritance diagram for BatteryLifetimeTest:
+ Collaboration diagram for BatteryLifetimeTest:

Public Member Functions

 BatteryLifetimeTest ()
virtual ~BatteryLifetimeTest ()
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
std::string GetName (void) const

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< LoadProfilem_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...
bool GetErrorStatus (void) const NS_DEPRECATED
TestCaseGetParent () const
bool IsStatusFailure (void) const
bool IsStatusSuccess (void) const
void SetDataDir (std::string directory)
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase. More...
bool MustAssertOnFailure (void) const
bool MustContinueOnFailure (void) const
std::string CreateDataDirFilename (std::string filename)
std::string CreateTempDirFilename (std::string filename)

Detailed Description

Test case of update remaining energy for RvBatteryModel and WifiRadioEnergyModel.

Definition at line 46 of file rv-battery-model-test.cc.

Constructor & Destructor Documentation

BatteryLifetimeTest::BatteryLifetimeTest ( )

Definition at line 104 of file rv-battery-model-test.cc.

References m_alpha, and m_beta.

BatteryLifetimeTest::~BatteryLifetimeTest ( )

Definition at line 112 of file rv-battery-model-test.cc.

Member Function Documentation

void BatteryLifetimeTest::CreateLoadProfiles ( void  )

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().

+ Here is the caller graph for this function:

void BatteryLifetimeTest::DoRun ( void  )
False if no error occurs.

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().

+ Here is the call graph for this function:

Member Data Documentation

double BatteryLifetimeTest::m_alpha
double BatteryLifetimeTest::m_beta
std::vector<LoadProfile> BatteryLifetimeTest::m_loadProfiles

Definition at line 99 of file rv-battery-model-test.cc.

Referenced by CreateLoadProfiles(), and DoRun().

The documentation for this class was generated from the following file: