ns-3
ns3::RvBatteryModel Class Reference

Rakhmatov Vrudhula non-linear battery model. More...

#include <rv-battery-model.h>

Inheritance diagram for ns3::RvBatteryModel:
Collaboration diagram for ns3::RvBatteryModel:

List of all members.

Public Member Functions

virtual double GetInitialEnergy (void) const
virtual double GetSupplyVoltage (void) const
virtual double GetRemainingEnergy (void)
virtual double GetEnergyFraction (void)
virtual void UpdateEnergySource (void)
void SetSamplingInterval (Time interval)
Time GetSamplingInterval (void) const
void SetOpenCircuitVoltage (double voltage)
 Sets open circuit voltage of battery.
double GetOpenCircuitVoltage (void) const
void SetCutoffVoltage (double voltage)
 Sets cutoff voltage of battery.
double GetCutoffVoltage (void) const
void SetAlpha (double alpha)
 Sets the alpha value for the battery model.
double GetAlpha (void) const
void SetBeta (double beta)
 Sets the beta value for the battery model.
double GetBeta (void) const
double GetBatteryLevel (void)
Time GetLifetime (void) const
void SetNumOfTerms (int num)
 Sets the number of terms of the infinite sum for estimating battery level.
int GetNumOfTerms (void) const
- Public Member Functions inherited from ns3::EnergySource
void SetNode (Ptr< Node > node)
 Sets pointer to node containing this EnergySource.
Ptr< NodeGetNode (void) const
void AppendDeviceEnergyModel (Ptr< DeviceEnergyModel > deviceEnergyModelPtr)
DeviceEnergyModelContainer FindDeviceEnergyModels (TypeId tid)
DeviceEnergyModelContainer FindDeviceEnergyModels (std::string name)
void StartDeviceModels (void)
void DisposeDeviceModels (void)
- Public Member Functions inherited from ns3::Object
virtual TypeId GetInstanceTypeId (void) const
template<typename T >
Ptr< T > GetObject (void) const
template<typename T >
Ptr< T > GetObject (TypeId tid) const
void Dispose (void)
void AggregateObject (Ptr< Object > other)
AggregateIterator GetAggregateIterator (void) const
void Start (void)
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount (const SimpleRefCount &o)
SimpleRefCountoperator= (const SimpleRefCount &o)
void Ref (void) const
void Unref (void) const
uint32_t GetReferenceCount (void) const
- Public Member Functions inherited from ns3::ObjectBase
void SetAttribute (std::string name, const AttributeValue &value)
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
void GetAttribute (std::string name, AttributeValue &value) const
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)

Static Public Member Functions

static TypeId GetTypeId (void)
 This method returns the TypeId associated to ns3::RvBatteryModel.

Additional Inherited Members

- Protected Member Functions inherited from ns3::EnergySource
double CalculateTotalCurrent (void)
void NotifyEnergyDrained (void)
void BreakDeviceEnergyModelRefCycle (void)
- Protected Member Functions inherited from ns3::Object
virtual void NotifyNewAggregate (void)
 Object (const Object &o)

Detailed Description

Rakhmatov Vrudhula non-linear battery model.

This (energy source) model implements an analytical non-linear battery model. It is capable of capturing load capacity and recovery effects of batteries. Batteries are characterized by 2 parameters, alpha and beta, which can both be obtained from the discharge curve of the batteries.

The model is developed by Daler Rakhmatov & Sarma Vrudhula in: "Battery Lifetime Prediction for Energy-Aware Computing" and "An Analytical High-Level Battery Model for Use in Energy Management of Portable Electronic Systems".

The real-time algorithm is developed by Matthias Handy & Dirk Timmermann in: "Simulation of Mobile Wireless Networks with Accurate Modeling of non-linear battery effects". The real-time algorithm is modified by the authors of this code for improved accuracy and reduced computation (sampling) overhead.


Member Function Documentation

double ns3::RvBatteryModel::GetAlpha ( void  ) const
Returns:
The alpha value used by the battery model.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetBatteryLevel ( void  )
Returns:
Battery level [0, 1].

References NS_LOG_FUNCTION, and UpdateEnergySource().

Referenced by GetEnergyFraction().

double ns3::RvBatteryModel::GetBeta ( void  ) const
Returns:
The beta value used by the battery model.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetCutoffVoltage ( void  ) const
Returns:
Cutoff voltage of battery.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetEnergyFraction ( void  )
virtual
Returns:
Energy fraction.

Implements GetEnergyFraction. For the RV battery model, energy fraction is equivalent to battery level.

Implements ns3::EnergySource.

References GetBatteryLevel().

double ns3::RvBatteryModel::GetInitialEnergy ( void  ) const
virtual
Returns:
Initial energy stored (theoretical capacity) in the battery.

Implements GetInitialEnergy.

Implements ns3::EnergySource.

References GetSupplyVoltage().

Time ns3::RvBatteryModel::GetLifetime ( void  ) const
Returns:
Lifetime of the battery.
int ns3::RvBatteryModel::GetNumOfTerms ( void  ) const
Returns:
The number of terms of the infinite sum for estimating battery level.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetOpenCircuitVoltage ( void  ) const
Returns:
Open circuit voltage of battery.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetRemainingEnergy ( void  )
virtual
Returns:
Remaining energy in energy source, in Joules

Implements GetRemainingEnergy.

Implements ns3::EnergySource.

References GetSupplyVoltage(), NS_LOG_FUNCTION, and UpdateEnergySource().

Time ns3::RvBatteryModel::GetSamplingInterval ( void  ) const
Returns:
The interval between each energy update.

Referenced by GetTypeId().

double ns3::RvBatteryModel::GetSupplyVoltage ( void  ) const
virtual
Returns:
Supply voltage at the energy source.

Implements GetSupplyVoltage.

Implements ns3::EnergySource.

Referenced by GetInitialEnergy(), and GetRemainingEnergy().

TypeId ns3::RvBatteryModel::GetTypeId ( void  )
static

This method returns the TypeId associated to ns3::RvBatteryModel.

Attributes defined for this type:

  • RvBatteryModelPeriodicEnergyUpdateInterval: RV battery model sampling interval.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: +1000000000.0ns
    • Flags: construct write read
  • RvBatteryModelOpenCircuitVoltage: RV battery model open circuit voltage.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 4.1
    • Flags: construct write read
  • RvBatteryModelCutoffVoltage: RV battery model cutoff voltage.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 3
    • Flags: construct write read
  • RvBatteryModelAlphaValue: RV battery model alpha value.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 35220
    • Flags: construct write read
  • RvBatteryModelBetaValue: RV battery model beta value.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.637
    • Flags: construct write read
  • RvBatteryModelNumOfTerms: The number of terms of the infinite sum for estimating battery level.
    • Set with class: ns3::IntegerValue
    • Underlying type: int32_t -2147483648:2147483647
    • Initial value: 10
    • Flags: construct write read

TraceSources defined for this type:

  • RvBatteryModelBatteryLevel: RV battery model battery level.
  • RvBatteryModelBatteryLifetime: RV battery model battery lifetime.

Reimplemented from ns3::EnergySource.

References GetAlpha(), GetBeta(), GetCutoffVoltage(), GetNumOfTerms(), GetOpenCircuitVoltage(), GetSamplingInterval(), ns3::MakeTraceSourceAccessor(), ns3::Seconds(), SetAlpha(), SetBeta(), SetCutoffVoltage(), SetNumOfTerms(), SetOpenCircuitVoltage(), ns3::TypeId::SetParent(), and SetSamplingInterval().

void ns3::RvBatteryModel::SetAlpha ( double  alpha)

Sets the alpha value for the battery model.

Parameters:
alphaAlpha.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetBeta ( double  beta)

Sets the beta value for the battery model.

Parameters:
betaBeta.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetCutoffVoltage ( double  voltage)

Sets cutoff voltage of battery.

Parameters:
voltageCutoff voltage.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetNumOfTerms ( int  num)

Sets the number of terms of the infinite sum for estimating battery level.

Parameters:
numNumber of terms.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetOpenCircuitVoltage ( double  voltage)

Sets open circuit voltage of battery.

Parameters:
voltageOpen circuit voltage.

References NS_ASSERT, and NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::SetSamplingInterval ( Time  interval)
Parameters:
intervalEnergy update interval.

This function sets the interval between each energy update.

References NS_LOG_FUNCTION.

Referenced by GetTypeId().

void ns3::RvBatteryModel::UpdateEnergySource ( void  )
virtual

Implements UpdateEnergySource. This function samples the total load (total current) from all devices to discharge the battery.

Implements ns3::EnergySource.

References ns3::EnergySource::CalculateTotalCurrent(), ns3::EventId::Cancel(), ns3::Simulator::IsFinished(), ns3::Now(), ns3::Simulator::Now(), NS_LOG_DEBUG, NS_LOG_FUNCTION, and ns3::Simulator::Schedule().

Referenced by GetBatteryLevel(), and GetRemainingEnergy().


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